1.0.11 • Published 7 years ago

sortera v1.0.11

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

sortera

npm version Codacy Badge MIT License

Sortera is a standalone, minimalistic yet powerful, javascript library that makes any HTML-table interactively sortable.

Highligts

  • Small footprint
  • Highly optimized code
  • Not relying on any third party libraries of any kind
  • Multi column sorting
  • Adapts to the application, supporting the following techiques

Sortera works by attaching events to the table headers of an existing table, hence your table need to have a html <thead> </thead> section, or <th> instead of <td> for column headers. See example tables to the rights.

For full documentation, see hexagon.github.io/sortera

Examples

Standalone usage

// Example usage.
var element = document.getElementById('#thetable');

sortera(theTable, {
  sortOrder:    [           // sortOrder        Array of columns to sort
    {col: 1, order: 1}      // sortOrder.col    Zero indexed column index
                            // sortOrder.order  1 = Ascending, -1 = Descending
  ],    
  multi:        true,
  ignore:       [5,2]
});

For a full implementation and demo, see hexagon.github.io/sortera/examples/usage.standalone.html

As jQuery plugin

// Example usage, jQuery plugin mode.
$('#thetable').sortera({
  sortOrder:    [           // sortOrder        Array of columns to sort
    {col: 1, order: 1}      // sortOrder.col    Zero indexed column index
                            // sortOrder.order  1 = Ascending, -1 = Descending
  ],    
  multi:        true,
  ignore:       [5,2]
});

For a full implementation and demo, see hexagon.github.io/sortera/examples/usage.jquery.html

Installation

cdn

Copy and paste one of the following script tags.

Minified

<script src="//cdn.56k.guru/js/sortera/latest/sortera.min.js"></script>

Full

<script src="//cdn.56k.guru/js/sortera/latest/sortera.js"></script>

Manual

  • Download latest zipball
  • Unpack
  • Grab sortera.js (or sortera.min.js) from the lib/ folder

Bower

bower install sortera

npm

npm install sortera

License

MIT

( Just use it, I really don't care what you do with it. )

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

1.0.0-rc.0

8 years ago