+ +
+
+
+
+ Notes
+
+
+
+ -
+
- Added v2.22.4. Instead of using the saveSort widget, this widget updates the hash tag to allow saving & sharing a sort applied to a tablesorter table. +
- Sort the tables in the demo below. Notice the changes made to the location hash, then reload the page to have the hash applied to the tables. +
- This widget requires jQuery version 1.7+. +
- This widget does NOT work with tablesorter v2.0.5. +
Options
+
+ Sort2Hash widget default options (added inside of tablesorter
+
+
+
+
+
+ Sort2Hash widget default options (added inside of tablesorter widgetOptions
)
+
+ TIP! Click on the link in the option column to reveal full details (or toggle|show|hide all) or double click to update the browser location.
+
+ Option | Default | Description |
---|---|---|
sort2hash_hash | +'#' |
+ + The hash should always be there. This option was added to allow setting extra hash parameters and/or hashbang or whatever. + | +
sort2Hash_separator | +',' |
+
+ Change the hash separator using this option. There are some limitations.
+
+
+ + In the location hash, the sort parameters are added as &tableID=column,direction, ... ,column,direction (no spaces). This option allows changing the column-direction separator, a comma by default, into the chosen separator.
+ *NOTE* Do not set this option to use a hash ( |
+
sort2Hash_tableId | +null |
+
+ Set an ID here to override the table id attribute.
+
+
+ + In the location hash, the sort parameters are added as &tableID=column,direction, ... ,column,direction (no spaces). The tableID is set by this option.
+ This option setting is prioritized over the actual table ID attribute. If neither are set, the sort2Hash_tableID > table.id attribute > table index+ |
+
Demo
+First Name | +Last Name | +Age | +Total | +Discount | +Date | +
---|---|---|---|---|---|
Peter | Parker | 28 | $9.99 | 20% | Jul 6, 2006 8:14 AM |
John | Hood | 33 | $19.99 | 25% | Dec 10, 2002 5:14 AM |
Clark | Kent | 18 | $15.89 | 44% | Jan 12, 2003 11:14 AM |
Bruce | Almighty | 45 | $153.19 | 44% | Jan 18, 2001 9:12 AM |
Bruce | Evans | 22 | $13.19 | 11% | Jan 18, 2007 9:12 AM |
First Name | +Last Name | +Age | +Total | +Discount | +Date | +
---|---|---|---|---|---|
Peter | Parker | 28 | $9.99 | 20% | Jul 6, 2006 8:14 AM |
John | Hood | 33 | $19.99 | 25% | Dec 10, 2002 5:14 AM |
Clark | Kent | 18 | $15.89 | 44% | Jan 12, 2003 11:14 AM |
Bruce | Almighty | 45 | $153.19 | 44% | Jan 18, 2001 9:12 AM |
Bruce | Evans | 22 | $13.19 | 11% | Jan 18, 2007 9:12 AM |
Javascript
+
+
+
+
+ HTML
+
+
+
+
+