aoColumnDefs class matching method buggy?

aoColumnDefs class matching method buggy?

cyberlussicyberlussi Posts: 6Questions: 0Answers: 0
edited September 2010 in Bug reports
Hello,

I am working with classes in my TH to controll the layout a little bit with dataTables ... I used to use class names like "sort-no", "sort-1", "sort-w0". Before aoColumnDefs I used to generate the arrays for specific parameters but I like aoColumnDefs much more as it is more straight forward. But I think the matching is not quiet perfect. It seems for me that my usual "sort-xy" classes are not correctly matched.

[code]


Aktion
Titel
Menu
Weiterleitung
Entwurf
#


[/code]
using
[code]
..
"aoColumnDefs": [
{ "bSortable" : false, "aTargets" : "sort-no" },
{ "sWidth": "60px", "aTargets": "sort-w0" }
] ,
..
[/code]

Somehow sort-w0 is interpreted as sort-no as well. The sort-w0 columns are rendered correctly with 60px width, but IN ADDITION no sorting is possible. I think aTargets matches not 100% ...???

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    aTargets is an array, not a string: http://datatables.net/usage/columns#aTargets . If you just put square brackets around your string, that should do the trick.

    Allan
  • cyberlussicyberlussi Posts: 6Questions: 0Answers: 0
    Yes that's it! I simply missed the array type ... thank you!

    working example:

    [code]
    "aoColumnDefs": [
    { "bSortable": false, "aTargets": [ "sort-no" ] },
    { "sWidth": "60px", "aTargets": [ "sort-w0" ] }
    ],
    [/code]
This discussion has been closed.