Can I only sort few columns?

Can I only sort few columns?

hkssonhksson Posts: 4Questions: 0Answers: 0
edited March 2011 in General
Hello,
My topic may not clear enough...
I am now using the multi column sort 's DataTables. And i want to give the user to sort the column A and D only (Not all the columns).
How should i do?

[code]



COLA
COLB
COLC
COLD



US00000001
Peter
Peter
5820


[/code]

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    http://datatables.net/usage/columns#bSortable :-)

    Allan
  • hkssonhksson Posts: 4Questions: 0Answers: 0
    Thank you. And i have one more question. I also want to filter column A and D only.

    Here is the js, i have used the parameter - bSearchable. But it still not work. Where is the problem?
    [code]"aoColumns": [{ "bSearchable": false, "bSortable": false},null,null,{ "bSearchable": false , "bSortable": false},null][/code]

    And the tfoot(under the tbody)
    [code]


    <!-- column A-->
    <!-- column D-->


    [/code]
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Your aoColumns:

    [code]
    "aoColumns": [
    {
    "bSearchable": false,
    "bSortable": false
    },
    null,
    null,
    {
    "bSearchable": false ,
    "bSortable": false
    },
    null
    ]
    [/code]
    has 5 columns in it - but your footer appears to have only two cells. Is there a reason for the difference? I presume thead has 5 columns in in?

    Allan
This discussion has been closed.