Wednesday 18 June 2014

Display sharepoint list data using jQuery templates

jQuery Templates: are default jQuery files, which we can use as plugin in HTML

Where we can use jQuery Templates: Any web applications, mean all browser related applications we can use jQuery Templates.
Target: I am going to demo this for microsoft HTML, Asp.Net,SharePoint, SPO

Download:
https://code.google.com/p/my-web-js/downloads/detail?name=jquery.tmpl.min.js&can=2&q=

or you can download from below site
http://plugins.jquery.com/loadTemplate/1.4.4/

Demo:
I am going to create a HTML page where i will create a Object and will bind data to jQuery Template.

Source Code:


In the above code "movies" object i have creted and assigned static values.
You can use any Client Object model to get from your server.
Ex: In SharePoint you can get the data from List using Client Object Model and assign to "movies" variable.

I have assigned "movies" variable to "results", "results2". Just show thw different jQuery Templates.
You can find my jQuery Templates "movieTemplate", "movieTemplate2".
You can customize the jQuery Templates as per your source (movies) variable.

Just copy Source code to HTML file, download jQuery Template and change the reference. Save.
Run.
You will see Out put.

You can change jQuery Templates as per your design requirement.