开发者

JQGrid asp.net mvc3. Custom inline edit. (Commercial license)

开发者 https://www.devze.com 2023-04-03 00:29 出处:网络
In the Edit Row Inline Example on the Trirand demo site: http://www.trirand.net/aspnetmvc/grid/editrowinlinecustomedittype

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 开发者_Python百科not be editable in rows where 'CustomerID' is anything else.

I am running v 4.1.2.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消