BorisMoore / jsrender

A lightweight, powerful and highly extensible templating engine. In the browser or on Node.js, with or without jQuery.
http://www.jsviews.com
MIT License
2.68k stars 340 forks source link

Paging example #269

Closed malpaso closed 9 years ago

malpaso commented 9 years ago

I have data outputting fine into a rendered table. I would like to add paging to the table/data and cannot seem to find an example of this. Is it possible?

BorisMoore commented 9 years ago

If you are just using JsRender, then you can page your data using your own code, and simply pass the paged arrays to the render method. But if you are using JsViews, you can leverage JsViews, use custom tags etc. as in the following sample (three variants using the same basic design):

http://jsfiddle.net/BorisMoore/zgr90L3s/ http://jsfiddle.net/BorisMoore/dg7x8mrc/ http://jsfiddle.net/BorisMoore/uu7opr3z/

The sample is not yet on jsviews.com - but I hope to add it there at some point.