This is not really an enhancement suggestion rather than a way to discuss some enhancements I'm working on but aren't quite ready for a proper PR yet. These changes can be viewed in the branch event-refactor.
The sortColumn function has been renamed and reworked to strictly provide the event handling code for a sort. That is, it accepts an event with a target and a sort order. This function is not intended to be called by user code. What this does it make the enableSorting method a little simpler, removing the nested function.
The new sortColumn function does the same thing as before, it accepts a <th> ID as string and a sort order and will trigger the sort on the associated column. It also accepts a numeric (0-based) column reference, allowing for a simple "sort the second column descending" via .timbles('sortColumn', 1, 'desc').
This is not really an enhancement suggestion rather than a way to discuss some enhancements I'm working on but aren't quite ready for a proper PR yet. These changes can be viewed in the branch
event-refactor
.The sortColumn function has been renamed and reworked to strictly provide the event handling code for a sort. That is, it accepts an event with a target and a sort order. This function is not intended to be called by user code. What this does it make the
enableSorting
method a little simpler, removing the nested function.The new
sortColumn
function does the same thing as before, it accepts a<th>
ID as string and a sort order and will trigger the sort on the associated column. It also accepts a numeric (0-based) column reference, allowing for a simple "sort the second column descending" via.timbles('sortColumn', 1, 'desc')
.