jqGrid - how to change title based on colModel sortable property
Posted
by
Greg
on Stack Overflow
See other posts from Stack Overflow
or by Greg
Published on 2010-11-16T17:49:35Z
Indexed on
2012/11/04
5:02 UTC
Read the original article
Hit count: 441
jqgrid
When the mouse hovers over each column I'd like the tooltip to indicate whether that column is sortable.
I am able to change the title attribute with something like this:
$("#List .ui-th-column").each(function(i) {
var isSortable = i % 2;
$(this).attr('title', isSortable ? "Not Sortable" : "Click header to sort.");
});
I'd like to replace the demo expression 'i % 2' with a check of the colMode's sortable property, but I can't figure out how to get the value of the colModel's sortable property.
colModel: [ { name: 'Name', index: 'Name', width: 100, sortable: true },
{ name: 'Note', index: 'Note', width: 200, sortable: false } ]
I've tried .getGridParam and .getColProp but I don't think the syntax I'm using is correct.
© Stack Overflow or respective owner