Show table in visualforce page with datatable.js

Datatable.js a nice custom interface which is used to show data in list with less amount of coding. It provides various functionality built-in such as sort, search, no of records to show in the page!

Yes, it is amazing and best plugin which makes developers life easy!

https://datatables.net/



Here in this post, a simple table which uses <apex:repeat> and shows list of opportunity, which uses fieldset to dynamically retrieve the fields to be shown.



This demo shows applying order, columndefs, date/time sorting, language based on the internationalisation etc..

Please take a look at the demo: https://sfblog-developer-edition.ap5.force.com/SampleDataTable

Important links:

Datatable.js - https://datatables.net/manual/
Moment.js(Date/Date time sorting) - https://datatables.net/blog/2014-12-18
Internationalisation plugin(Language and locale) - https://datatables.net/plug-ins/i18n/

Note: The order of the plugins placed and the method called is very important 

Comments

Popular Posts