<li>In <spanclass="version">v2.15.6</span>, added <code>group_saveGroups</code>&<code>group_saveReset</code> options. More details are included in the "Options" section.</li>
<li>In <spanclass="version">v2.14</span>, added <code>group_dateString</code> option. More details are included in the "Options" section.</li>
<li>In <spanclass="version">v2.13</span>, added <code>group_separator</code> option &<code>group-separator-#</code> header class name. To see this in action, check out the <ahref="example-parsers-file-type.html">file type parser demo</a>.</li>
when <code>true</code>, the group headers become clickable and collapse the rows below it.
</td>
</tr>
<tr>
<td>group_collapsed</td>
<td><code>false</code></td>
<td>
when <code>true</code> and <code>group_collapsible</code> is also <code>true</code>, all groups will start collapsed (<spanclass="version">v2.11</span>)
</td>
</tr>
<tr>
<td>group_saveGroups</td>
<td><code>true</code></td>
<td>Remember collapsed groups (<spanclass="version">v2.15.6</span>)
<ul>
<li>This option saves the currently collapsed groups, using the group name.</li>
<li>Collapsed groups are saved by column and group class name, so that the groups can be dynamically changed and still remember the correct collapsed groups. Try changing the group names (using the sliders) in the demo below & then collapsing some groups several times; go back to previous groups and it will remember which groups were collapsed.</li>
<li>Because the group name is saved, groups with a number range (e.g. "group-number-10"; see the "Numeric" column below) will show a different range depending on sort direction; in this situation, each sort direction is saved independently.</li>
<li>This option requires the <code>$.tablesorter.storage</code> utility contained within the <code>jquery.tablesorter.widgets.js</code> file.</li>
</ul>
</td>
</tr>
<tr>
<td>group_saveReset</td>
<td><code>null</code></td>
<td>Element used to clear saved collapsed groups (<spanclass="version">v2.15.6</span>)
<ul>
<li>This option should contain a jQuery selector string or jQuery object pointing to an element to be used to reset (clear) the list of collapsed groups.</li>
<li>You can also clear the saved collapsed groups by calling this function: <code>$.tablesorter.grouping.clearSavedGroups(table);</code> (table would be either the table DOM or table jQuery object).</li>
<li>This option requires the <code>$.tablesorter.storage</code> utility contained within the <code>jquery.tablesorter.widgets.js</code> file.</li>
</ul>
</td>
</tr>
<tr>
<td>group_count</td>
<td><code>" ({num})"</code></td>
<td>
Allows you to add custom formatting, or remove, the group count within the group header. Set it to <code>false</code> or an empty string to remove the count.
When the <code>group-separator</code> class name is added, it uses the setting from this option to split the table cell content for grouping <spanclass="version">v2.13</span>.<br>
<br>
If your content has mixed separators (e.g. <code>images/cats/burger-time.jpg</code>), you can set this option to use a regular expression:
<preclass="prettyprint lang-js">// the above example becomes: ["images", "cats", "burger-time", "jpg"]
Use this function to modify the group header text before it gets applied. It provides various parameters (<code>txt, col, table, c, wo</code>) to make it work for any of the table columns and data. See the comments in the example below for more details.
<ul>
<li><code>txt</code> - current text of the group header.</li>
<li><code>col</code> - current table column being grouped (zero-based index).</li>
<li><code>table</code> - current table (DOM).</li>
<li><code>c</code> - table data from <code>table.config</code>.</li>
<li><code>wo</code> - table widget options from <code>table.config.widgetOptions</code>.</li>
// If there are empty cells, name the group "Empty"
return txt === "" ? "Empty" : txt;
}</pre>
</td>
</tr>
<tr>
<td>group_callback</td>
<td><code>null</code></td>
<td>
Use this function to further modify the group header to include more information (i.e. group totals). Parameters include (<code>$cell, $rows, column, table</code>). See the example below for more details <spanclass="version">v2.12</span>.
<ul>
<li><code>$cell</code> - current group header table cell (jQuery object).</li>
<li><code>$rows</code> - current group rows (jQuery object).</li>
<li><code>column</code> - current table column being grouped (zero-based index).</li>
<li><code>table</code> - current table (DOM).</li>
<li>group_week: (<code>[ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ]</code>) - Named days of the week.</li>
<li>group_time: (<code>[ "AM", "PM" ]</code>) - Time of day.</li>
</ul>
</td>
</tr>
<tr>
<td>group_dateString</td>
<td>(see description)</td>
<td>
When the <code>"group-date"</code> class name is set on a column, this function is used to format the date string. This is the default function:
<preclass="prettyprint lang-js">// you can just return date, date.toLocaleString(), date.toLocaleDateString() or d.toLocaleTimeString()
group_dateString : function(date) {
return date.toLocaleString();
}</pre>
Other functions that can be used are <code>date</code> (alone), <code>date.toLocaleString()</code>, <code>date.toLocaleDateString()</code> or <code>d.toLocaleTimeString()</code>. See <ahref="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#Conversion_getter">this reference</a> for more details.
<h3>Group header class names (when changing the grouping, notice that the <em>sort doesn't change, just the position and names of the group headers</em>):</h3>
<li><code>"group-word"</code> (same as <code>"group-word-1"</code>) - group the rows using the first word it finds in the column's parsed data.</li>
<li><code>"group-word-n"</code> (<code>"n"</code> can be any number) - group the rows using the nth word in the column<spanclass="remark">*</span>.</li>
<li><code>"group-separator"</code> (same as <code>"group-separator-1"</code>) - group the rows using the text between the start and first separator that it finds in the column's parsed data (<spanclass="version">v2.13</span>).</li>
<li><code>"group-separator-n"</code> (<code>"n"</code> can be any number) - group the rows using the nth separated group in the column (<spanclass="version">v2.13</span>)<spanclass="remark">*</span>.</li>
<li><code>"group-letter"</code> (same as <code>"group-letter-1"</code>) - group the rows using the first letter it finds in the column's parsed data.</li>
<li><code>"group-letter-n"</code> (<code>"n"</code> can be any number) - group the rows using letters 1 through n (if n = 2, then it's the first 2 letters) in the column's parsed data.</li>
<li><code>"group-number"</code> (same as <code>"group-number-1"</code>) - group the rows by the number it finds in the column (step of one).</li>
<li><code>"group-number-n"</code> (<code>"n"</code> can be any number) - group the rows into blocks of every n values. So, if n = 10, the groups will be 0-9, 10-19, 20-29, etc</li>
<li><code>"group-date"</code> - group the rows by full date (this shows the current UTC time corrected for your time zone)</li>
<li><code>"group-date-year"</code> - group the rows by year</li>
<li><code>"group-date-month"</code> - group the rows by month<spanclass="remark">*</span></li>
<li><code>"group-date-day"</code> - group the rows by month/day<spanclass="remark">*</span></li>
<li><code>"group-date-week"</code> - group the rows by day of the week<spanclass="remark">*</span></li>
<li><code>"group-date-time"</code> - group the rows by time<spanclass="remark">*</span></li>
<li><code>"group-false"</code> - disable grouping of rows for a column (<spanclass="version">v2.11</span>).</li>
<spanclass="remark">*</span> When sorting some columns, different group headers with the same group name may exist (try "group-date-week" and "group-date-time"). To make these columns sort specifically by the group you want, you'll need to modify the parser.