Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/giventofly/yet-another-js-table-sorter

A jquery plugin (one day vanilla js) to sort (number,text,date,..., implement your sort algorythm) rows of table (same table or different table)
https://github.com/giventofly/yet-another-js-table-sorter

javascript jquery sorting table

Last synced: 16 days ago
JSON representation

A jquery plugin (one day vanilla js) to sort (number,text,date,..., implement your sort algorythm) rows of table (same table or different table)

Awesome Lists containing this project

README

        

# yet-another-sort-table

* you can click on the header and sort.

$ todo:
a better faq/readme.

include yajts.js, style.css and jquery in your html.
check index.html for an example.

# configuration

* add to the table a class, and another class for the tbody.
* choose the sorting algorythim using data-sort="sort-function" in every td in the head you want to sort.

# edit the object yajtsConf using this parameters:

* fixedColumns
number of columns to fix

* you can add other methods to compare (date, text, number/values by default) by adding an object in the compareMethods

//this will not work, just a generic example
nameCompareFunction: function(param1, param2) {
return param1 - param2;
}

* define table class to define

tableToSort = '.class'

* define class of table body

tableBodyClass = '.class';