jQWidgets Forums

jQuery UI Widgets Forums Grid sortBy is not stable

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • sortBy is not stable #85170

    GSerjo
    Participant

    Could you please clarify why executing several times xjgw.sortBy($grid, sortColumn, xjgh.outOfSortDirection(sortInformation.sortdirection)) change line order for lines with the same cell values? Looks like sortBy is not stable.

    For instance, we have a grid, after executing xjgw.sortBy($grid, sortColumn, xjgh.outOfSortDirection(sortInformation.sortdirection)) twise (sort by A) lines with 10 values change there position.

    A | B
    —–
    10| F
    10| B
    14| D
    3 | K

    Could you please suggest how to make it stable.

    sortBy is not stable #85172

    Peter Stoev
    Keymaster

    Hi GSerjo,

    I don’t know what that function is. Such code is definitely not part of our package.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    sortBy is not stable #85175

    GSerjo
    Participant

    Hi Peter,

    it presents in the api (search by sortby) this one http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-api.htm

    here’s the signature.

    $('#jqxGrid').jqxGrid('sortby', 'columndatafield', 'asc');

    P.S. sorry in the question above was code on typescript

    as a result following method is called

    export function sortBy(grid: JQuery, column: string, direction: string) {
        asBanned(grid).jqxGrid('sortby', column, direction);
    }
    sortBy is not stable #85178

    Peter Stoev
    Keymaster

    Hi GSerjo,

    I know how it is in the API, but the way you call it is incorrect i,e xjgw.sortBy($, should be $(“#someID”).jqxGrid(‘sortby’,…. Also sorting is by single column value and other columns do not play any role in the sorting. If you wish, you may implement your own sorting function based on custom criteria as shown in the custom sorting example on our Grid demos page.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    sortBy is not stable #85181

    GSerjo
    Participant

    Peter, thanks for the quick reply.

    Is there any way to create another grid based on the previous one and save sorting? (i.e. resort new grid as the previous one).

    I got the getsortinformation and applied it, sorted by column. Is there any way to apply full sortinformation without sorting by column?

    sortBy is not stable #85193

    Peter Stoev
    Keymaster

    Hi GSerjo,

    We do not have such built in method in our Grid unfortunately.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.