开发者

How do I edit a jqgrid from javascript

开发者 https://www.devze.com 2023-01-19 07:19 出处:网络
I have a jqgrid that has several columns including a checkbox column that indicates if an item is selected.

I have a jqgrid that has several columns including a checkbox column that indicates if an item is selected.

Underneath that I have a dropdown menu and a text box. The idea开发者_StackOverflow社区 is that each item in the dropdown menu is a column in the jqgrid. Then all I need to do is modified all of the checked rows with the contents of the text box for that column. So a quick mass update mechanism if you will.

The problem is, is that I can't figure out how to update a specific cell. Any tips or documentation that can help me? Thanks!


You can use for example setRowData (see jqGrid documentation) or setCell to update the data in the grid. The functions getCol, getCell or getRowData could help you the examine the row data. Another old answers: this and this could be helpful if you decide to search data in the grid with respect of jQuery.


Here's the "answer" I came up with to my problem. I wanted to edit only rows that were editable. Using setCell would overwrite my editable field with a non-editable one. So I looked at the HTML for a given row while it is in the edit state and passed that into the 'setCell' method. It feels 'hackish' though and if someone knows a better way, I'm all ears.

0

精彩评论

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