How to apply sorting on hidden column

How to apply sorting on hidden column

28.vivek.s28.vivek.s Posts: 69Questions: 0Answers: 0
edited January 2011 in General
hi allan,

I have table with 4 columns out of them 3 are visible and 1 is hidden.
I have to apply sorting on that hidden column (External sorting should be applied).
I have tried with
[code]
oTable.fnSortListener('#Sortingcol_1',3);
[/code]
and onclick of div tag I have tried
[code]
oTable.fnSort([3,'desc']); [/code]also
but none of the above gave me proper output.when i am apply sorting on visible column through same code it's working properly...but not on hidden column.
please let me know how to sort hidden column.

Regards
Vivek

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    There are several answers to your question - depending on the use case :-).

    If you want to add sorting to another element, then fnSortListener is the right thing to do (but not to another column, since it will have it's own listener already). fnSort is right if you want to do it programmatically. iSortData can be used when you want the user to click on one column, but have it sort on another's data.

    Allan
  • JAltJAlt Posts: 1Questions: 0Answers: 0
    Hi,

    Really keen to use iSortData as I have a column but it needs to be sorted using another column. Unfortunately I couldn't find any other references to iSortData? Just wondering if you could point me in the right direction.

    Thanks.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Sorry - should have been iDataSort: http://datatables.net/usage/columns#iDataSort

    Allan
This discussion has been closed.