The plugins site is currently in development.
We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.
SORT
This jQuery extension will allow you to easily sort a jQuery object by one or more attributes. This was developed to sort JSON data, but can sort any jQuery object with attributes.
sort(attr, sortDesc)
Accepts:
attr
- String. The name of the attribute to sort on. (ex. "Attribute1")
- Array. A list of attributes to sort. (ex. ["Attribute1", "Attribute2",...])
sortDesc (optional)
- String ("asc" or "desc")
- Boolean(true = Descending, false = Ascending)
Example:
$(dataSet).sort("userName", "asc");
$(dataSet).sort(["division", "employee"], false);sort(attr)
Accepts:
Key/Value Map
Key = "Attribute to Sort";
Value = "Ascending/Descending" (See Above for details)
Example:
$(dataSet).sort({"companyName":"desc", "employeeName":true});