jQuery.loadTemplate can be used for easily displaying data sets. The example below is an example of utilising this. When the search button is pressed, data is fetched from the server in the form of a JSON object. Processing this data is done client side, and allows for great client experience, sending the minimal amount of data from the server (just a single json object, and a template). Another benefit this brings is we have all our data in an easy to manipulate javascript object on the client.
The example below makes use of paging a javascript array with the jQuery.loadTemplate function. Simply by passing in options to set paged to true, which page to display, and the number of elements per page, the function will only output the elements on that page. The navigation of pages is entirely separate from the function (the next and previous buttons are not provided).
id | name | price | tags | coordinates |
---|