I’m using jqgrid’s form editing feature.
Can I programmatically set the readonly attribute of the editoptions options in the jqgrid?
I need to determine if as specific field would be readonly or not, depends on one of the current row cell value.
You can set
readonlyattribute inside ofbeforeShowFormon the field (see here) or alternatively you can set/removereadonly: 'readonly'property (see here) of theeditoptionsfor the column inside ofbeforeInitDatawhich will be called before the edit form will be created. You can usesetColPropfor example to changeeditoptions(see here an example).To implement the changes depends on the cell value from some column you need just get the id of selected row with respect of
getGridParamand then get the cell value usinggetCell(see here).In any cases I recommend you to use
recreateForm: trueoption of form editing. It should be default options in my opinion.