Using Salesforce RemoteObjects with JSRender : Create a stateless Table

Salesforce has just released RemoteObjects and its really promising. You can now do lot more by just writing a page and without any need of a controller.

RemoteObjects now lets you do DML, Query etc just using the Javascript and to add they are not even counted against the limit. Lets see how can we use the same to create a stateless Pageblock table.

Ingredients 

  • Jquery : For DOM Manipulation
  • JSRender : For templating
  • Some styling

Jquery

Jquery is a very popular DOM manipulation library and if you are into JS you probably don't need any introduction of the same. Jquery in this DEMO does the job of DOM manipulation like picking up templates, changing DOM etc.


JSRender

JSRender is not so popular templating engine which is successor of JQuery Templates. Lot of things have changed from JQuery Templates and they are now much more easier to use than ever. I have been preferring JSRender because they need very less code and are easier to use and understand.


Styling

To give our table a familiar look of PageBlockTable we will have to borrow some styling for Salesforce.

Styling from Salesforce


The Page



The end result

Whats Advantage ?

  • Almost zero viewstate
  • Pretty fast loading time and refresh
  • Suitable for mobiles and large pages



No comments:

Post a Comment