Is it possible to hide or manipulate the jqGrid "sort" icons?
Asked Answered
O

2

4

I have a custom, multi-column sort attached to my jqGrid instance by means of the onSortCol event:

onSortCol: function(index, iCol, sortorder) {
    //Manipulate the sort order via custom code, and store it in postData.

    return 'stop';
}

The problem I'm running into is that the sort icons in the column headers are falling out of synch with the actual sorting, because their behavior is slightly different from what I'm trying to implement.

I've tried using setParam('sortname'...), but that specifically doesn't change the sort icon. I've also tried sortGrid, but that raises the onSortCol event in a way that seems to be indistinguishable from a user's click.

If hiding via CSS is the only option, what's the most effective selector to target ONLY the sort headers in a specific grid?

Overcoat answered 8/4, 2010 at 16:4 Comment(0)
O
4

I am currently using the following CSS:

#gbox_MyGrid .s-ico span {
    display:none;
}

For a grid with an ID of MyGrid.

Overcoat answered 8/4, 2010 at 16:12 Comment(0)
A
0

I disable the sort for a particular column with 'sortable: false,' like below:

{ name:'ColumnName', index:'ColumnName', width: 80, sortable: false, align:'center'}

Good luck.

Agle answered 14/5, 2020 at 0:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.