Search code examples
tablesortersemantic-ui

semantic ui table sorter not working


Im using the wonderful semantic ui framework. I'm trying to declare a sortable table as they demonstrate here: http://semantic-ui.com/collections/table.html

It says it makes use of a modified version of kylefox's tablesort plugin.

Im not absolutley sure what they mean by that? is the plugin included or do you need to include it? and do you need to initialize that plugin?

I found in the semantic source that they check if the $.fn.tablesort() method exists and if so call in on all .sortable.table's elements

I dont see any errors in the console and when you click the table header it just doesnt do anything.

Anyone that can advise me on this please?


Solution

  • add this to your js:

    http://semantic-ui.com/javascript/library/tablesort.js

    it provides the script for $.tablesort() as mentioned

    and call $('table').tablesort() when document is ready.