Jqgrid add link to column headers

I am using jqgrid to create a grid. I looked, but I can not find a solution. I am trying to add links to column headings.

Any help appreciated. Thanks

+3
source share
3 answers

Use jQuery to bind the click event:

jQuery(document).ready(function() {
    $("#jqgh_colName").click(function() {
        alert('jqgh_colName clicked');
    });
});
+2
source

jqGrid creates column header names using the names in the list colName. Therefore, you can try putting markup directly on this list during grid initialization:

colNames:['<a href="#test">Test</a>', 'Column 2', ... ],

I have not tested this, therefore YMMV. Also keep in mind that there may be usability issues - the user probably expects a click on the header to sort the column.

+1

Source: https://habr.com/ru/post/1743864/


All Articles