开发者

jqGrid on column header click event

开发者 https://www.devze.com 2023-04-05 22:15 出处:网络
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

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.
  }); 
0

精彩评论

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