Reputation: 1018
In the Edit Row Inline Example on the Trirand demo site: http://www.trirand.net/aspnetmvc/grid/editrowinlinecustomedittype
How can I make e.g. 'OrderDate' and 'ShipName' editable, but ONLY IF e.g. 'CustomedID' is 'CHOPS'? Cells should not be editable in rows where 'CustomerID' is anything else.
I am running v 4.1.2.
Upvotes: 0
Views: 919
Reputation: 222007
Inline editing supports the following feature which you can use: if a row (<tr>
element) has "not-editable-row" class the editing of the row will not permitted.
So you can include in your jqGrid the custom loadComplete
event handler which tests the contain of 'CustomedID'
column for all rows and add "not-editable-row"
class on the rows where the contain is not equal to 'CHOPS'
. The example from the answer could help you. You should just rename myAltRowClass
to not-editable-row
and change the criteria used in the testing from $(row.cells[iCol]).children("input:checked").length>0
to $(row.cells[iCol]).text() !== 'CHOPS'
.
Upvotes: 1