someJsonObj= {b:5,a:6,c:4,d:[9,10],e:true,f:3,g:{T:2},h:1};
someJsonObj=
someJsonObj= a_sort.collection(someJsonObj); //default.. by:"value"
someJsonObj= a_sort.collection(someJsonObj, {by:"_key"} ); //note: "_key" has special meaning for sorting json [v.3] can sort JSON with varied data
API:
a_sort.select( selectElement [, paramObj] );
sorts the OPTIONs (default is by text)
- selectElement (required) is dom-element or id-string of a SELECT
a_sort.list( listElement [, paramObj] );
sorts the LIs (default is by innerHTML)
- listElement (required) is dom-element or id-string of a UL (or OL)
a_sort.table( tableElement [, paramObj] );
sorts the TRs in TBODY (default is by innerHTML)
- tableElement (required) is dom-element or id-string of a TABLE
a_sort.childrenOf( containerDomElement, tagString [, paramObj] );[v.2]
sorts the dom-elements of tagString in the containerDomElement (default is by innerHTML)
- containerDomElement (required) is dom-element or id-string of a dom-element
- tagString (required) is a tag-string (ie; "div", "span", etc.)
a_sort.collection( object [, paramObj] );
this is the core function in this library. The functions above use this. Generally, applications do not call this except for sorting JSON.
- object (required) can be array, or json
- paramObj (optional) .. is in json format
.. by ie; "innerHTML", "cells[1].innerHTML", (many other possibilities) - (optional)
.. customCompare "numeric", "currency", or func(a, b) - (optional - default is alphabetical)
.. reverseFlag - (optional)
.. caseInsensitiveFlag - (optional)
.. stripHTMLFlag - (optional)