multi-column with fnSortListener

multi-column with fnSortListener

scottpezscottpez Posts: 2Questions: 0Answers: 0
edited March 2011 in General
Hi,

Is there a way to do a multi-column sort using with the fnSortListener function?

I have three different columns of static data in my datatable that I would like to sort on when clicking external elements. So I am thinking I can use the fnSortListener function with the external sort buttons. But then I have a forth column of data that is hidden and the data is dynamic and can be changed by other parts of my web interface. I would like my datatable to always be sorted by this hidden column first and the selected column I mention above second. When the data in this hidden column is changed, I then simply redraw the table to get it to update.

1. Is there a way to do a multi-column sort with fnSortListener much like fnSort([[index_of_hidden_column>, 'desc'], [index_of_static_data_column], 'desc'])?

2. Or better yet, is there a way to permanently add the dynamic hidden column as the first column to sort on and then the column sorted by the fnSortListener would only add the second column to the sort?

Thanks in advance for any advice on this.

Scott

Replies

  • scottpezscottpez Posts: 2Questions: 0Answers: 0
    Hi,

    I resolved this issue. I found a previous forum post that led me to the aaSortingFixed initialization parameter. This allows me to have the dynamic data column always sorted first and the fnSortListener only adds to this sort.

    Thanks,
    Scott
This discussion has been closed.