I have a kendo grid with data in it and multiple columns (say col 1, 2, and 3). Columns 1, 2, 3 need to be able to be edited (or preventing editing) based off the values of each other. This is row specific.
For instance, if column 1 (date) is < column 2 (date) then column 3 is not allowed to be edited.
I know it’s simple enough to disable or enable an entire column but my requirements are row specific. So row 1 could have column 3 enabled and row 2 could have column 3 disabled.
Any thoughts?
My suggestion is creating an editor function that validates the condition. This of course has the disadvantage that is an ad-hoc solution but … it works!
Lets have the following entries (data of the DataSource):
Then I define the grid as:
Where
col1andcol2are dates andcol3is a string that can be edited if and only ifcol1is less thancol2.I define
checkAndEditfunction as follow:Where I generate the corresponding
inputfield ifcol1<col2and otherwise invokecloseCellfor exitingeditmode.You can see it running here