I have a column field type having values (editable, readonly). all the rows will have one of these values populated.
I want to enable/disable toolbaroption edit only if column value is editable for selected row.
how can i achieve that in jqgrid.
I have a column field type having values (editable, readonly). all the rows will have one of these values populated.
I want to enable/disable toolbaroption edit only if column value is editable for selected row.
how can i achieve that in jqgrid.
If I understand you correct you want to enable/disable "Edit" or "Delete" buttons of the navigator based of the selected row. So that you will have
if no rows is selected or the selected row is non-editable or the standard navigator toolbar
if the row is editable.
The criteria whether the column "editable" or "readonly" seems me wrong because it is criteria column on the column and not on the row, but you can implement easy your own custom criteria.
The implementation could be
To enable/disable the "Edit" and "Del" buttons we add/remove the 'ui-state-disabled' class on the buttons of the navigator toolbar. In the code above I mark all rows with even numbers as "non-editable". In your case you can use any other criteria which has more sense.
You can see the demo live here.