Module: module/sort-sk

sort-sk

Allows sorting the members of the indicated element by the values of the data attributes. Add children to that generate click events and that have child content, such as buttons. Add a data-key * attribute to each child element that indicates which data-* attribute the children should be sorted on. Note that all sorting is done numerically, unless the 'data-sort-type=alpha' attribute is set on the element generating the click, in which case the sorting is done alphabetically. Additionally a single child element can have a data-default attribute with a value of 'up' or 'down' to indicate the default sorting that already exists in the data.
Attributes
Name Description
target The id of the container element whose children are to be sorted.
Source:
Example
An example usage, that will present two buttons to sort the contents of
  div#stuffToBeSorted.

   <sort-sk target=stuffToBeSorted>
     <button data-key=clustersize data-default=down>Cluster Size </button>
     <button data-key=stepsize data-sort-type=alpha>Name</button>
   </sort-sk>

   <div id=stuffToBeSorted>
     <div data-clustersize=10 data-name=foo></div>
     <div data-clustersize=50 data-name=bar></div>
     ...
   </div>