sortReset demo & clarification of sortLocaleCompare

This commit is contained in:
Rob Garrison 2012-02-27 06:12:48 -06:00
parent 042f89913e
commit 5d0624ccb2
2 changed files with 12 additions and 5 deletions

View File

@ -731,12 +731,14 @@
</tr> </tr>
<tr id="sortlocalecompare"> <tr id="sortlocalecompare">
<td>sortLocaleCompare</td> <td><a href="#" class="toggle2">sortLocaleCompare</a></td>
<td>Boolean</td> <td>Boolean</td>
<td>false</td> <td>false</td>
<td> <td>
Boolean flag indicating whenever to use javascript <code class="hilight">String.localeCampare</code> method or not. This is only used when comparing text strings.<br> Boolean flag indicating whenever to use javascript <code class="hilight">String.localeCompare</code> method or not.
In Tablesorter version 2.0.6+, the default sort was replaced with an alpha-numeric sort. To over-ride this behaviour, set this <code class="hilight">sortLocaleCompare</code> to <code class="hilight">true</code>. <div class="collapsible">
This is only used when comparing text with international character strings. A sort using localeCompare will sort accented characters the same as their unaccented counterparts.
</div>
</td> </td>
<td></td> <td></td>
</tr> </tr>
@ -748,7 +750,7 @@
<td> <td>
Setting this option to <code class="hilight">true</code> will allow you to click on the table header a third time to reset the sort direction. However, it does not restore the original sort order, it merely clear the sort from the header. <span class="tip"><em>New!</em></span> in v2.0.27. Setting this option to <code class="hilight">true</code> will allow you to click on the table header a third time to reset the sort direction. However, it does not restore the original sort order, it merely clear the sort from the header. <span class="tip"><em>New!</em></span> in v2.0.27.
</td> </td>
<td></td> <td><a href="../index.html">Example</a></td>
</tr> </tr>
<tr id="sortmultisortkey"> <tr id="sortmultisortkey">

View File

@ -16,7 +16,10 @@
<script src="js/jquery.tablesorter.widgets.js"></script> <script src="js/jquery.tablesorter.widgets.js"></script>
<script> <script>
$(function(){ $(function(){
$('table').tablesorter({ widgets: ['zebra', 'columns'] }); $('table').tablesorter({
widgets: ['zebra', 'columns'],
sortReset: true
});
}); });
</script> </script>
@ -51,5 +54,7 @@
</tbody> </tbody>
</table> </table>
<p>This is a quick demo of the columns & zebra widget with the "sortReset" option set to true (clicking on a sort header a third time will reset the sort)</p>
</div> </div>
</body></html> </body></html>