tablesorter/README.md

178 lines
13 KiB
Markdown
Raw Normal View History

2012-12-19 17:00:47 +00:00
tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes.
tablesorter can successfully parse and sort many types of data including linked data in a cell.
### Notice!
* Because of the change to the internal cache, the tablesorter v2.16+ core, filter widget and pager (both plugin & widget) will only work with the same version or newer files.
2014-09-08 22:03:26 +00:00
### [Documentation](//mottie.github.io/tablesorter/docs/)
2012-12-19 17:00:47 +00:00
2014-09-08 22:03:26 +00:00
* See the [full documentation](//mottie.github.io/tablesorter/docs/).
* All of the [original document pages](//tablesorter.com/docs/) have been included.
* Information from my blog post on [undocumented options](//wowmotty.blogspot.com/2011/06/jquery-tablesorter-missing-docs.html) and lots of new demos have also been included.
* Change log moved from included text file into the [wiki documentation](//github.com/Mottie/tablesorter/wiki/Changes).
2012-12-19 17:00:47 +00:00
### Demos
2014-09-08 22:03:26 +00:00
* [Basic alpha-numeric sort Demo](//mottie.github.com/tablesorter/).
* Links to demo pages can be found within the main [documentation](//mottie.github.io/tablesorter/docs/).
* More demos & playgrounds - updated in the [wiki pages](//github.com/Mottie/tablesorter/wiki).
2012-12-19 17:00:47 +00:00
### Features
* Multi-column alphanumeric sorting and filtering.
2014-09-08 22:03:26 +00:00
* Multi-tbody sorting - see the [options](//mottie.github.io/tablesorter/docs/index.html#options) table on the main document page.
* Supports [Bootstrap v2 and 3](//mottie.github.io/tablesorter/docs/example-widget-bootstrap-theme.html)
* Parsers for sorting text, alphanumeric text, URIs, integers, currency, floats, IP addresses, dates (ISO, long and short formats) & time. [Add your own easily](//mottie.github.io/tablesorter/docs/example-parsers.html).
* Inline editing - see [demo](//mottie.github.io/tablesorter/docs/example-widget-editable.html)
2012-12-19 17:00:47 +00:00
* Support for ROWSPAN and COLSPAN on TH elements.
* Support secondary "hidden" sorting (e.g., maintain alphabetical sort when sorting on other criteria).
2014-09-08 22:03:26 +00:00
* Extensibility via [widget system](//mottie.github.io/tablesorter/docs/example-widgets.html).
* Cross-browser: IE 6.0+, FF 2+, Safari 2.0+, Opera 9.0+, Chrome 5.0+.
* Small code size, starting at 25K minified
2012-12-19 17:00:47 +00:00
* Works with jQuery 1.2.6+ (jQuery 1.4.1+ needed with some widgets).
2013-03-27 23:21:09 +00:00
* Works with jQuery 1.9+ ($.browser.msie was removed; needed in the original version).
2012-12-19 17:00:47 +00:00
### Licensing
* Copyright (c) 2007 Christian Bach.
2014-09-08 22:03:26 +00:00
* Original examples and docs at: [http://tablesorter.com](//tablesorter.com).
* Dual licensed under the [MIT](//www.opensource.org/licenses/mit-license.php) and [GPL](//www.gnu.org/licenses/gpl.html) licenses.
### Related Projects
* [Plugin for Rails](//github.com/themilkman/jquery-tablesorter-rails). Maintained by [themilkman](//github.com/themilkman).
* [PHP templating engine for tablesorter](//github.com/alexweissman/bootsole) by [alexweissman](//github.com/alexweissman).
2012-12-19 17:00:47 +00:00
### Special Thanks
2014-09-08 22:03:26 +00:00
* Big shout-out to [Nick Craver](//github.com/NickCraver) for getting rid of the `eval()` function that was previously needed for multi-column sorting.
* Big thanks to [thezoggy](//github.com/thezoggy) for helping with code, themes and providing valuable feedback.
* Big thanks to [ThsSin-](//github.com/TheSin-) for taking over for a while and also providing valuable feedback.
* Also extra thanks to [christhomas](//github.com/christhomas) and [Lynesth](//github.com/Lynesth) for help with code.
2013-10-18 18:38:46 +00:00
* And, of course thanks to everyone else that has contributed, and continues to contribute to this forked project!
### Questions?
2014-09-08 22:03:26 +00:00
* Check the [FAQ](//github.com/Mottie/tablesorter/wiki/FAQ) page.
* Search the [main documentation](//mottie.github.io/tablesorter/docs/) (click the menu button in the upper left corner).
* Search the [issues](//github.com/Mottie/tablesorter/issues) to see if the question or problem has been brought up before, and hopefully resolved.
* If someone is available, ask your question in the `#tablesorter` IRC channel at freenode.net.
2014-09-08 22:03:26 +00:00
* Ask your question at [Stackoverflow](//stackoverflow.com/questions/tagged/tablesorter) using a tablesorter tag.
* Please don't open a [new issue](//github.com/Mottie/tablesorter/issues) unless it really is an issue with the plugin, or a feature request. Thanks!
2012-12-19 17:00:47 +00:00
### Change Log
2014-09-08 22:03:26 +00:00
View the [complete listing here](//github.com/Mottie/tablesorter/wiki/Changes).
2012-12-19 17:00:47 +00:00
2014-08-09 16:29:10 +00:00
#### <a name="v2.17.7">Version 2.17.7</a> (8/9/2014)
2014-09-08 22:03:26 +00:00
* Core: Do not detach rows before appending to prevent ajax rows from disappearing. Fixes [issue #701](//github.com/Mottie/tablesorter/issues/701).
2014-08-09 16:29:10 +00:00
* Docs: Fix change log links.
2014-09-08 22:03:26 +00:00
* Filter: attached external select causing javascript errors. Fixes [issue #702](//github.com/Mottie/tablesorter/issues/702)
2014-08-09 16:29:10 +00:00
2014-08-02 02:31:33 +00:00
#### <a name="v2.17.6">Version 2.17.6</a> (8/1/2014)
* Core
* Adding a class name of `parser-false` to a column will now automatically set `sorter-false` and `filter-false` behavior.
2014-09-08 22:03:26 +00:00
* Add extractor type which allows giving a column two parsers, one to extract content from an input/select and the second to parse the extracted text. Thanks to [TheSin-](//github.com/TheSin-)!
2014-08-02 02:31:33 +00:00
* Ensure custom parsed data adheres to the `ignoreCase` option.
* Add a delay to any sort if there is an update in progress. This prevents issues with a sort being applied causing duplicate rows to be added to the table, hopefully.
* The `widthFixed` option now finds both visible `th` and `td` cells within the first row of the tbody to set column width percentages.
2014-09-08 22:03:26 +00:00
* Ensure all rows have a set role for screen readers (`role="row"`). Fixes [issue #690](//github.com/Mottie/tablesorter/issues/690).
* Redefine `c.$headers` when building headers for new/replaced header cells (not just content). Fixes [issue #683](//github.com/Mottie/tablesorter/issues/683).
2014-08-02 02:31:33 +00:00
* Docs
* Fixed lots of minor HTML issues (e.g. missing closing `</li>` &amp; `<p>` tags)
* Parsers
* Add parser for textareas within the `parser-input-select.js` file.
* Modify input &amp; textarea parser to only update the table cache when:
* The user presses enter (input) or alt + enter (textarea) within the element.
* When the element is blurred.
* Or, when the mouse leaves the tbody.
* Editable
* Add two new options:
* `editable_autoAccept`: accepts any changes made to the table cell automatically (`true` by default)
* `editable_validate`: a function used to validate the changes; return a valid string (`null` by default)
2014-09-08 22:03:26 +00:00
* Modify `editable_columns` type check to prevent javascript errors. See [pull #688](//github.com/Mottie/tablesorter/issues/688). Thanks [scratcher28](//github.com/scratcher28)!
2014-08-02 02:31:33 +00:00
* Limit the `editable_columns` array value to columns within the table.
* Filter
* Make all options show within the current select when the `filter-onlyAvail` class is set on a column.
* Updated &amp; added docs for `$.tablesorter.filter.buildSelect` function to allow external calls to modify filter select options.
* Update `filter_selectSource` to accept arrays instead of a function. This was documented as working, but it wasn't coded until now. Sorry!
* Add `filter_selectSourceSeparator` option:
* Include a separator within the `filter_selectSource` array (e.g. "a-z|A through Z").
* The text that is left of the separator is added to the option value, the the text on the right is added to the option text.
* So `"a-z|A through Z"` becomes `<option value="a-z">A through Z</option>`.
2014-09-08 22:03:26 +00:00
* Fixes [issue #692](//github.com/Mottie/tablesorter/issues/692).
* Add `role="row"` to the filter row. Fixes [issue #697](//github.com/Mottie/tablesorter/issues/697).
* Any match inputs now follow the `filter_startsWith` setting. See [this Stackoverflow](//stackoverflow.com/q/25070448/145346) question.
2014-08-02 02:31:33 +00:00
* Pager
* The `ouput` option can now include user modifiable `startRow` (`{startRow:input}`) or `page` (`{page:input}`) inputs within the output.
2014-09-08 22:03:26 +00:00
* Remove selected attribute from page selector options. Fixes [issue #700](//github.com/Mottie/tablesorter/issues/700).
2014-08-02 02:31:33 +00:00
* Resizable
2014-09-08 22:03:26 +00:00
* Update `$.tablesorter.addHeaderResizeEvent` function's first parameter `table` to accept table DOM elements as well as jQuery objects. Fixes [issue #687](//github.com/Mottie/tablesorter/issues/687).
2014-08-02 02:31:33 +00:00
2014-07-17 17:40:11 +00:00
#### <a name="v2.17.5">Version 2.17.5</a> (7/17/2014)
* Core
2014-09-08 22:03:26 +00:00
* Update `config.totalRows` variable before initialization. Fixes [issue #670](//github.com/Mottie/tablesorter/issues/670).
2014-07-17 17:40:11 +00:00
* Add `config.table` variable; useful for functions that only pass the `config`.
* Ensure widget init functions are only called once; and set indicator for all widgets, not just ones with options (for `hasWidget`).
* Docs
2014-09-08 22:03:26 +00:00
* Add [custom filter widget search types demo](//mottie.github.io/tablesorter/docs/example-filter-custom-search.html).
2014-07-17 17:40:11 +00:00
* Add `imgAttr` parser "utility option" instructions.
* Filter
2014-09-08 22:03:26 +00:00
* Force cache build on initial search when `delayInit` is `true`. Fixes [issue #678](//github.com/Mottie/tablesorter/issues/678).
* Make `config.filteredRows` count available within `filterInit` event. Fixes [issue #670](//github.com/Mottie/tablesorter/issues/670).
* Selects now obtain parsed data when it is set for a particular column. Fixes [issue #684](//github.com/Mottie/tablesorter/issues/684).
* Ignore change event if input value hasn't changed, otherwise it interferes with other events within the table. Fixes [issue #685](//github.com/Mottie/tablesorter/issues/685).
2014-07-17 17:40:11 +00:00
* Ensure search query is parsed for both specific filter types and non-filter type searches, if the column is set to use parsed data.
2014-09-08 22:03:26 +00:00
* Filter initialization ("filterInit") event is now delayed to prevent filterStart &amp; filterEnd event spamming. Fixes [issue #668](//github.com/Mottie/tablesorter/issues/668).
* Filter formatter functions are now required to call a function after initialization to delay "filterInit" event. Fixes [issue #668](//github.com/Mottie/tablesorter/issues/668).
2014-07-17 17:40:11 +00:00
* Output
2014-09-08 22:03:26 +00:00
* Update download method which allows downloading files without modifying the server htaccess. Fixes [issue #681](//github.com/Mottie/tablesorter/issues/681).
2014-07-17 17:40:11 +00:00
* Pager
2014-09-08 22:03:26 +00:00
* Initialize without building cache when `delayInit` is `true`. Fixes [issue #678](//github.com/Mottie/tablesorter/issues/678).
2014-07-17 17:40:11 +00:00
* Parsers
* Update input/select element binding
* Add image alt parser; set `config.imgAttr` with attribute to target (default is `"alt"`).
* Add `select-text` parser which grabs the currently selected option text instead of the select value.
* Resizable
* Remove unused grip code
2014-07-04 12:36:50 +00:00
#### <a name="v2.17.4">Version 2.17.4</a> (7/4/2014)
* Docs
* Copied the tablesorter `initialized` option from the event section into the configuration; renamed the event appropriately (`tablesorter-initialized` event)
* Added notes about how to bind to "init" events; they should be bound before initializing tablesorter because in most cases, the events fire before the binding occurs.
* Core
* Add `$.tablesorter.hasWidget(table, 'widgetId')` function. It returns a boolean value of `true` when the named widget is actively applied to the table.
* Filter
* Add `filter_searchFiltered` option to allow disabling the search of already filtered rows.
2014-09-08 22:03:26 +00:00
* The `filter_initialized` flag now gets set appropriately. Fixes [issue #668](//github.com/Mottie/tablesorter/issues/668).
* Include any column filter in determination of searching already filtered rows. Fixes [issue #669](//github.com/Mottie/tablesorter/issues/669).
* Add internal `config.filteredRows` variable. Provides a value of the number of currently filtered (visible) rows. Fixes [issue #670](//github.com/Mottie/tablesorter/issues/670).
2014-07-04 12:36:50 +00:00
* Add internal `config.totalRows` variable. Provides a value of the total number of rows in the current table, not including info-tbody rows.
* Fix change/search event being ignored for selects &amp; filterFormatter extensions.
* `filterInit` and `filterEnd` events now pass `config` as a parameter.
* Pager
* Removed from beta status
2014-09-08 22:03:26 +00:00
* Filtered rows now equals the total rows when `ajaxProcessing` returns an array. Fixes [issue #667](//github.com/Mottie/tablesorter/issues/667).
* Update the `config.filteredRows` when using ajax to match the internal `config.pager.filteredRows`. See [issue #670](//github.com/Mottie/tablesorter/issues/670).
2014-07-04 12:36:50 +00:00
* Widget only: ensure `pagerComplete` event fires on initialization.
* Resizable
2014-09-08 22:03:26 +00:00
* Bind mousemove to document instead of table header. Makes resizable handle use consistent with other resizing libraries, as the user would expect. Fixes [issue #665](//github.com/Mottie/tablesorter/issues/665).
* Add `resizable_throttle` option to allow throttling of the mousemove/resize event. Set this option to `true` or a number between 1 and 10 to add a throttling delay. Fixes [issue #662](//github.com/Mottie/tablesorter/issues/662).
2014-07-04 12:36:50 +00:00
2014-09-08 22:03:26 +00:00
* UITheme: non-existent columns no longer cause a js error. Fixes [issue #672](//github.com/Mottie/tablesorter/issues/672).