How to "no sort" by default?
How to "no sort" by default?
Hi guys
I want to keep using the sort functionality provided by datatables but, by default I want to turn this off.
I'm using Sphinx (www.sphinxsearch.com/) to return my SQL matches. Sphinx orders these matches by relevance based on my keywords. So I'd like to keep that as the default sort order.
Then, if a user would prefer to sort by column X, then datatables can kick in and work it's magic.
Any ideas how I set this up?
I've looked at aaSorting, but I can't set this to false http://datatables.net/usage/options
I want to keep using the sort functionality provided by datatables but, by default I want to turn this off.
I'm using Sphinx (www.sphinxsearch.com/) to return my SQL matches. Sphinx orders these matches by relevance based on my keywords. So I'd like to keep that as the default sort order.
Then, if a user would prefer to sort by column X, then datatables can kick in and work it's magic.
Any ideas how I set this up?
I've looked at aaSorting, but I can't set this to false http://datatables.net/usage/options
This discussion has been closed.
Replies
But by default I don't want datatables to sort anything (can I use aaSorting=false..... or similar?)
Any help is appreciated :)
Sorting off initially, but user can still click to sort on columns: aaSorting: [] (i.e. empty array).
Allan
Allan
In FireFox sorting is done on the first column even with aaSorting: []. I cleared the cache and forced a refresh with ctrl+F5. Also restart firefox and windows. Nothing helped I then looked at the firefox cache and the JSON object was actaully cached too and in the correct sort i want (sql order by).
The page source in FireFox also shows aaSorting: [].
Because of all this i think it's a bug and not a cache issue. Any ideas?
EDIT:
This was some kind of weird caching issue. I don't get it since I cleared cache and restarted PC. But it just worked fine after the weekend...
I'm using firefox version 8.0.1