开发者

How do I get the ID of the selected cell in jqgrid?

Is there a way to get the ID of the cell that is focused inside a selected row?

UPDATE:

I'm us开发者_如何学Pythoning inline editing. and using context menu for the grid.

I want to be able to show the context menu only for specific cells inside the row.


It seems to me that you can use onRightClickRow event handler. You will have information about the rowid and you can use context menu using the information.

UPDATED: If you use jquery.contextmenu.js from http://www.trendskitchens.co.nz/jquery/contextmenu/, which you can find in the plugins subdirectory of the last 4.0 version of jqGrid you can bind all jqGrid rows with data with $("tr.jqgrow", this).contextMenu(...) to context menu. Inside of onContextMenu: function(e) {/*here*/} handler you can get row id within the onContextMenu function:

var rowId = $(e.target).closest("tr.jqgrow").attr("id");
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜