Using plain old JavaScript to gain maximum performance

If you want to display a large number of read-only rows, then prefer plain old JavaScript over framework code. This will improve the rendering performance. The code for this would look like the following snippet, which produces the same result as the logic covered in the earlier section. Let's take a look at the code:

<aura:component>    <aura:handler name="render" value="{!this}" action="{!c.onRender}"/>     <div aura:id="main">     </div></aura:component>

The controller code uses JavaScript ECMA5 script to draw the DOM via JavaScript:

({    onRender : function(component, event, helper) {        var mainBody = component.find("main").getElement();        for(var i=0 ; i<=100 ; i++){ var parentDiv = document.createElement("div"); ...

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.