Sorting!

Sorting!

TrollchikTrollchik Posts: 80Questions: 1Answers: 0
edited August 2010 in General
Hi Allan
I have question about disable a sorting. I mean don't use the the initializating feature. U said in previous discussion:

http://datatables.net/forums/comments.php?DiscussionID=1583

that it can be made in 1.7 release.

I'm interesting is it really was made or not?

Thank u very much!

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Yes this is possible using aoColumnDefs and bSortable: http://datatables.net/usage/columns

    Allan
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    do u have some class which disable sorting on a column? i mean i want to make it using "aoColumnDefs", bcs in some situations i don't know the numbers of columns! The idea what i want to make is: i have an array of objects sorted by 'ASC'. but when i apply DataTables plugin to my table my sorting dissappear, bcs DataTable is using its personal sorting (i consider by asc in first column by default)! How i can eliminate this?

    if u can give please link on some example!

    Thanks A lot!
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    So you want to disable sorting on columns which have a given class? A small modification of the example will do it:

    [code]
    /* Using aoColumnDefs */
    $(document).ready(function() {
    $('#example').dataTable( {
    "aoColumns": [
    { "bSortable": false, "aTargets": [ "no_sort" ] }
    ] } );
    } );
    [/code]
    Allan
This discussion has been closed.