0

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.

burktelefon
  • 988
  • 2
  • 8
  • 27

1 Answers1

1

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'.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • I only want some cells in the row editable, not the entire row. – burktelefon Sep 08 '11 at 08:11
  • @user323313: Look at [here](http://stackoverflow.com/questions/4307147/jqgrid-how-to-make-a-column-editable-in-the-add-dialog-but-not-during-inline-e/4308172#4308172). The answer shows how you can **dynamically** change `editable` or any other properties of the column for the row *before* the editing started. In the way you can implement any scenario. – Oleg Sep 08 '11 at 10:33