jQWidgets Forums

jQuery UI Widgets Forums Grid Restrict sort up to two columns

This topic contains 3 replies, has 2 voices, and was last updated by  Martin 6 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Restrict sort up to two columns #102522

    dan123
    Participant

    Hi I have this example where i am using jqxgrid with the sortmode set as ‘many’. I was thinking is there a workaround to sort only by 2 columns and after that no more. So it will function in a way that only 2 columns can be sorted at a time like primary and secondary.

    If this is not possible, then can i get a workaround which i already did partially in my example where if do 1st sort it will show the column name and direction. and if i sort a different column it will show the column name and direction, so on.

    Here is my jsfiddle:
    http://jsfiddle.net/gwQrY/279/

    Restrict sort up to two columns #102524

    Martin
    Participant

    Hello dan123,

    There isn’t such build-in functionality.
    But here is your Example updated, so you can sort by up to 2 columns only as you need.

    Best Regards,
    Martin

    jQWidgets Team
    http://www.jqwidgets.com/

    Restrict sort up to two columns #102527

    dan123
    Participant

    Hi Martin,

    I want to show what column was sorted and the direction, that is why i had the log tags. I really liked your example, i have been trying to add log tags to show what two columns are being sorted.
    $(“#log”).html(“1st column: ” + sortedcolumn + ” ” + sortdirection + “”);
    $(“#log2”).html(“2nd column: ” + sortedcolumn + ” ” + sortdirection + “”);

    I would like to see if a example of this. I want the log tags to show as you click on the first column and then second column it will show the next. And if one or the other column is not sorted then it will show 1st column null and 2nd column null

    http://jsfiddle.net/8bs20z59/2/

    Restrict sort up to two columns #102549

    Martin
    Participant

    Hello dan123,

    I have updated the Example again.
    I hope that this is what you are trying to achieve.

    Best Regards,
    Martin

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.