I want the name of the column on right click of a column header in jqGrid. Any code would be appreciated.
相关问题
- How to bind a dropdown list inside jqgrid row cell
- jQgrid filterToolbar fails with searchOnEnter
- Detecting checkbox event in jqGrid cell
- How to alter data received from the server before
- How to access other row data from a cell's cus
相关文章
- jqGrid Row Object in onSelectRow
- Weird behavior of jqgrid Grouping
- jQuery - jqGrid - submit buttons in each row
- JqGrid: sorting of local data
- How to Expand/Shrink row in Jqgrid dynamically
- VB.net FileUpload using Ajaxcall
- jqGrid addRowData doesn't work with grid as su
- How to turn off column highlighting (on hover) for
You can bind
contextmenu
event to all column headers. Every header is<th>
element and so its DOM support cellIndex property. The cellIndex property gives you the index of column header. If you would use the same index incolModel
you will get the definition of the column. Thename
property gives you the column name.The corresponding code could be about the following:
The demo uses the code. Just use the right mouse click on the column header and you will see the results:
All jqGrid cells have an
aria-described-by
property which is composed ofgridId_columnname
. You can use this to get your column name.For grid cells..
For column headers, besides Oleg's answer, you can do this..