Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
644 views
in Technique[技术] by (71.8m points)

javascript - Is it possible to hide or manipulate the jqGrid "sort" icons?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I am currently using the following CSS:

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

For a grid with an ID of MyGrid.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...