Couldnt find any example on grouping using jquery tmpl() so thought id post what I came up with (that works) in case anyone else was trying to do it.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
See the JQuery API docs for the basic usage of templates.
I’ve written an extension to this function, which allows multiple categories to be grouped.
Usage:
$(JQuery template).tmpl_sort(data,[options,] array of groups)• For JQuery template, data and options, see the tmpl API documentation.
• array of groups should be an array consisting of strings which identify the groups.
Code:
Example at http://jsfiddle.net/gBTzU/