I am usi开发者_StackOverflowng jquery and jqGrid and I am looking for an oncolumnheader (or something similar) click event. I have used the "onSortCol:" property of grid but it is not giving me the DOM object on which the click is done. Is there a function or any way to hook click event to a column header in jqGrid?
Thanks in Advance,
Try applying your click event after the grid has been created using the gridComplete event. http://www.trirand.com/jqgridwiki/doku.php?id=wiki:events
gridComplete: function(){
$("#id-of-your-grid th").click(function() {...});
}
The column headers are th
elements so it will probably be as easy as:
$("#id-of-your-grid th").click(function() {...});
Some body that could not achieve above answers can try below code:
$(".ui-th-column").click((e) => {
// get the data info of the "e" object from there.
});
精彩评论