jQWidgets Forums

jQuery UI Widgets Forums DataTable Controlling the sort arrow

This topic contains 2 replies, has 2 voices, and was last updated by  BrentH 10 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Controlling the sort arrow #67038

    BrentH
    Participant

    I am sorting a couple of columns by another hidden field, so that the column sorts correctly. Everything works well, but the arrows do not appear in the column header. How can I make the ascending or descending arrows appear on the original column?

    
    $('#parcelTable').on('sort', function (event) {
            var args = event.args;
            var sortcolumn = args.sortcolumn;
            if (sortcolumn == 'address') {
                var adsorttype = addSortAsc ? 'desc' : 'asc';
                addSortAsc = !addSortAsc;
                $("#parcelTable").jqxDataTable('sortBy', 'sortableadd', adsorttype);
            } else if (sortcolumn == 'lastsaledt') {
                var sdsorttype = saleDtAsc ? 'desc' : 'asc';
                saleDtAsc = !saleDtAsc;
                $("#parcelTable").jqxDataTable('sortBy', 'sortablelsd', sdsorttype);
            }
        });
    
    Controlling the sort arrow #67070

    Peter Stoev
    Keymaster

    Hi BrentH,

    By default they appear – http://jsfiddle.net/jqwidgets/gY4MT/. Check whether the jqwidgets/styles/images folder is in your project.

    Best Regards,
    Peter Stoev

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

    Controlling the sort arrow #67095

    BrentH
    Participant

    They do appear for the OTHER columns in my table. But for “Address” and “LastSaleDt” they don’t appear. And they do appear if I don’t do the second sort that is programmed in the event.

    With any column, when you sort by another column, it seems to be standard behavior for the images disappear from the previously sorted column. I just want to override that behavior.

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

You must be logged in to reply to this topic.