jQWidgets Forums

jQuery UI Widgets Forums Grid Default sort column

Tagged: , ,

This topic contains 2 replies, has 2 voices, and was last updated by  Peter Stoev 9 years, 9 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Default sort column #74497

    Mastard
    Participant

    Hi,

    I’m pretty new to jqWidgets, but I’ve been working around a little bit with jqxGrid, and until now I’m doing fine. But I’ve got a little problem at first data load.

    I use the grid in virtual mode, so all the filter/sorting logic is server-side. I have no way to know the sortfield and sortdirection at initialization, so I can’t set it in my source object.

    Although, i can have these information in the data I get at my first AJAX request. But I don’t find how to tell the grid that I want the sort icon on a particular column, without triggering a reaload, meaning an other AJAX request… I tried to do that in the ‘beforeprocessing function of my source object :

    beforeprocessing: function(data) {
                        this.sortcolumn = data.sortField;
                        this.sortdirection = data.sortDir;
                    }

    But it does not render the icon on the header of my grid.

    Thanks for any help !

    Cheers

    Default sort column #74505

    Mastard
    Participant

    Quick edit :

    I also tried this, for testing purpose :
    $(".myGrid").jqxGrid('sortby','id', false, null, false);

    I thought the last argument was here to prevent reloading data, but an AJAX request is sent anyway.

    Default sort column #74511

    Peter Stoev
    Keymaster

    Hi Mastard,

    There are no such params in the sortby at first. Secondly, there is no solution in your case. These source object settings should be defined with the source object if you want sorting to be applied by default.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.