jQWidgets Forums

jQuery UI Widgets Forums Grid invoke grid sorting

This topic contains 1 reply, has 1 voice, and was last updated by  krnacm 10 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • invoke grid sorting #56496

    krnacm
    Participant

    Hi,

    Please, is it possible to invoke sorting on the grid, that the data will be sorted by selected direction and column?

    something similar to this

    
    $('#jqxgrid).jqxGrid('sort');
    

    Thanks in advance.

    Kind regards,
    Matej

    invoke grid sorting #56500

    krnacm
    Participant

    I figure out it.

    
            var sortinformation = $('#jqxgrid).jqxGrid('getsortinformation');
            // The sortcolumn represents the sort column's datafield. If there's no sort column, the sortcolumn is null.                            
            var sortcolumn = sortinformation.sortcolumn;
            // The sortdirection is an object with two fields: 'ascending' and 'descending'. Ex: { 'ascending': true, 'descending': false }                            
            var sortdirection = sortinformation.sortdirection;
    
            $('#jqxgrid).jqxGrid('sortby', sortcolumn, sortdirection);
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.