sType: html - Sorting Not Working

sType: html - Sorting Not Working

akreiderakreider Posts: 33Questions: 0Answers: 0
edited February 2010 in General
I'm trying to sort a table on a linked field (using



You can see it sorts by City. But won't sort by Name.

Here is the URL
http://www.energyjustice.net/map/searchtest-2.html

Replies

  • akreiderakreider Posts: 33Questions: 0Answers: 0
    It looks like I might need to have the aoColumns sortable values BEFORE the aoColumns sType values.

    Example this works:
    [code]
    "aoColumns": [{"bSortable":true}, {"bSortable":true}, {"bSortable":true}, {"bSortable":false}],
    "aoColumns": [{"sType":"html"}, null, null, null]

    This doesn't work:
    "aoColumns": [{"sType":"html"}, null, null, null],
    "aoColumns": [{"bSortable":true}, {"bSortable":true}, {"bSortable":true}, {"bSortable":false}]
    [/code]
  • allanallan Posts: 63,217Questions: 1Answers: 10,415 Site admin
    I'm surprised it works at all with two aoColumns definitions :-). I'm guessing that the browser will simply throw away the first one, and use the second.

    You want to do something like:

    [code]
    "aoColumns": [
    { "bSortable": true, "sType": "html" },
    { "bSortable": true },
    ...
    }
    [/code]
    Note that bSortable is true by default, you don't need to specify this, unless you want to be verbose.

    Allan
This discussion has been closed.