开发者

jqGrid - how to save a row cell by clicking on a link

开发者 https://www.devze.com 2023-01-07 06:36 出处:网络
I have a grid with some hidden datas and also I have some custom links on each row (eg: \"publish/unpublish\", \"edit\", \"delete\"). When I click on the link \"publish/unpublish\" on each row, the ro

I have a grid with some hidden datas and also I have some custom links on each row (eg: "publish/unpublish", "edit", "delete"). When I click on the link "publish/unpublish" on each row, the row data should get updated automatically and the values should get posted 开发者_运维问答to the server. After successful submit the grid row should get refreshed automatically with new values. How can I achieve this functionality with the above scenario.

NOTE: When I click on the link, the row should never turn to editable mode.


You don't wrote which editing mode you use. It seems you use cell editing. If you use cell editing mode you can use saveCell instead (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:cell_editing#methods). If you use line editing mode you can use saveRow to save the data (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing#saverow).

To send additional hidden column data (if you use line editing mode) to the server you can use following additional column option for the hidden columns:

editable: true, editrules: { edithidden: false }

See http://www.trirand.com/jqgridwiki/doku.php?id=wiki:colmodel_options and Sending additional parameters to editurl on JQgrid.

Any cell can have additional class "not-editable-cell" to deny switching of editing mode in case of cell editing mode. You can use classes column option to add this class to the link column.

0

精彩评论

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