History: Tablesorter
Preview of version: 37
Tablesorter
Tiki uses the Rob Garrison fork of the tablesorter jQuery plugin to add the ability for users to filter, sort, paginate and otherwise manipulate tables used in Tiki.
Please consider, that the implementation of tablesorter is still marked as experimental by Feb. 2015.
Features
Tablesorter allows the following to be done without refreshing the page through use of jQuery and Ajax:
- Sorting by clicking on active column headers.
- sorts all items even if only a portion are retrieved from the server and displayed
- Filtering by typing in text or using a dropdown
- all items are filtered even if only some are shown
- Pagination with pager controls
- number of rows shown can be expanded as well
- Sticky headers
- the header row stays visible as you scroll down even when the top of the table is not visible
- Resizable columns
- place your cursor on the right edge of a header cell until the cursor turns into a resize icon - then click and move to the right or left
- Column selector to hide columns
- the button on the top left of the table allows you to hide a column for the duration of the session
- Auto hide columns for small viewing windows
Tables where Tablesorter is available in Tiki
Below are the tables for which Tablesorter may be applied. For plugins, Tablesorter is optional even if the Tablesorter feature is activated. For other standard tables in Tiki, Tablesorter is automatically applied if the Tablesorter feature is turned on.
Feature | Table | Tiki version |
---|---|---|
Plugin | PluginFancytable | 12 |
Plugin | PluginTrackerlist | 12 |
Users | Admin users list (tiki-adminusers.php) | 12 |
Wiki | List of wiki pages (tiki-listpages.php) | 14 |
Forum | List of forums (tiki-forums.php) | 14 |
Forum | Topic list for a forum (tiki-view_forum.php) | 14 |
Forum | Admin forums (tiki-admin_forums.php) | 14 |
Configuration
Below are the parameters that are used for plugins where this feature is available. See the related plugin documentation pages for more information and examples. This table of parameters may be added to a documentation page by using PluginInclude and referring to the startinclude and stopinclude text for the starting and stopping points of the include.
startinclude
Prerequisites
In order to use tablesorter,
- Javascript must be enabled
- Enabled by default at Admin > Features > Programmer (tab)
- jQuery Sortable Tables must be activated
- Enable at Admin > Features > Interface (tab)
- For the server parameter to work for a plugin, and to apply tablesorter to any tiki table that is not a plugin, ajax must be enabled.
- Enable at Admin > Features > Interface (tab)
Parameter | Purpose | Usage | Optional | Since |
---|---|---|---|---|
sortable | Turn sorting / filtering / paginating on and set sort button and save settings. This setting is needed for all other features to work. | Enter y to allow sorting and n to disallow (n is the default). Enter type:save to allow sorts to be saved between page refreshes. Enter type:reset;text:buttontext to allow sorting and show an unsort button with custom text. Enter type:savereset;text:buttontext to allow the same for saved sorts. |
optional, but needs to be set to something other than n for the features to be turned on | 4.0, enhanced in 12.0 |
server | Choose to use browser or server to filter, sort and paginate | Enter y to have the server do the sorting and filtering through Ajax and n to have the browser do it (n is the default). Set to y (and also set the Paginate parameter) if you do not want all rows fetched at once, but rather fetch rows as you paginate, filter or sort. together with trackers (trackerlist) tablesorter might not fetch all items -> in this case use server="y" and it should work. |
optional | 12.0 |
sortList | To pre-sort columns or disallow sorting by colum | Enter bracketed numbers for column number (first column = 0) and sort direction (0 = ascending, 1 = descending, n = no sort, y = allow sorting but no pre-sort). For example: [0,y],[1,0],[2,n]. If the first pre-sorted or no filter column is not the first column, then you should use the y parameter (as in [0,y]) to assign all previous columns. | optional | 4.0, enhanced in 12.0 |
tsortcolumns | Set data type of column for more accurate sorting and set group headers | Set type and group settings for each column, using | to separate columns. To show group headings upon page load, the sortList parameter will need to be set for a column with a group setting. Group will not work in plugins where the server parameter is set to y. type tells the sorter what type of date is being sorted and choices include: text, digit, currency, percent, usLongDate, shortDate, isoDate, dateFormat-ddmmyyyy, ipAddress, url, time. Also handle strings in numeric columns with string-min and string-max. Handle empty cells with empty-top, empty-bottom or empty-zero. group creates automatic row headings upon sort with the heading text determined by the setting as follows: letter (first letter), word (first word), number, date, date-year, date-month, date-day, date-week, date-time. letter and word can be extended, e.g., word-2 shows first 2 words. number-10 will group rows in blocks of ten. |
optional | 12.0 |
tsfilters | Set filter settings | Enter y for a blank text filter on all columns, or n for no filters. Or set custom column filters separated by | for each column for the following filter choices and parameters: Text - type:text;placeholder:xxxx (For PluginTrackerlist this will be an exact search, for other plugins partial values will work.) Dropdown - type:dropdown;placeholder:****;option:****;option:****;option:**** Options generated automatically if not set and the server parameter is not y . Use value=Display label to have the option value be different than the displayed label in the dropdown. Date range - type:date;format:yyyy-mm-dd;from:2013-06-30;to:2013-12-31%%%(from and to values set defaults for these fields when user clicks on the input field) Numeric range - type:range;from:0;to:50%%%No filter - type:nofilter For example: tsfilters="type:dropdown;placeholder:Type to filter..." would result in a dropdown filter on the first column with all unique values in that column in the dropdown list. |
optional | 12.0 |
tsfilteroptions | To set additional filter-related options | The following options are available: type:reset (adds button to take off filters), and style:hide(Filters are revealed upon mouseover. Hide doesn't work when date and range filters are used.). To use both, set tsfilteroptions="type:reset;text:button text;style:hide" | optional | 12.0 |
tspaginate | To add pagination controls and text | Enter y to set default values based on the site setting for maximum records in listings (on the pagination table of the Look & Feel admin panel). Set custom values as in the following example: max:40;expand:60;expand:100;expand:140 | optional, except needs to be set when the server parameter is set to y | 12.0 |
tscolselect | To hide and prioritize columns | Add a button for hiding and re-showing columns. Also sets priority for dropping columns when browser is too narrow. Set each column to a number between 1 and 6 (1 is highest priority and last to be dropped) or to critical to never hide or drop. An example with 4 columns: tscolselect="critical|4|5|6" | optional | 14.0 |
stopinclude