fnSorting does not work

fnSorting does not work

adcadc Posts: 4Questions: 0Answers: 0
edited November 2012 in General
I would like to configure client side sorting.
But I do not succeed in running fnSort.

I get data via ajax (static data for dev purpose), and I bind the fnSort to the th click event:

[code]
, "sAjaxSource": "data/data.txt"
, "fnHeaderCallback" : function(nHead, aData, iStart, iEnd, aiDisplay){
var ths = $(nHead).find('th');
for(i = 0; i

Replies

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    No idea I'm afraid. Please link us to a test page showing the issue.

    Allan
  • adcadc Posts: 4Questions: 0Answers: 0
    edited November 2012
    The following demo seems to works right. But I set "bServerSide": false. So is the issue related to server side processing?
    http://live.datatables.net/ativuf/8
  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    If you enable server-side processing the sorting is done at the server, so your script must be able to do the required sorting ( http://datatables.net/usage/server-side ).

    Allan
  • adcadc Posts: 4Questions: 0Answers: 0
    Thanks. Now, before starting server side development: isn't it possible to get data via AJAX and then to do client side sorting and filtering?
  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    Sure - just don't enable server-side processing :-)
    Example: http://datatables.net/release-datatables/examples/ajax/ajax.html

    Allan
  • adcadc Posts: 4Questions: 0Answers: 0
    Perfect!
    I thought server-side processing was mandatory for AJAX sources. Now both sorting and filtering are working right.

    Thanks a lot.
This discussion has been closed.