Reader small image

You're reading from  Learning Salesforce Lightning Application Development

Product typeBook
Published inJul 2018
PublisherPackt
ISBN-139781787124677
Edition1st Edition
Concepts
Right arrow
Author (1)
Mohit Shrivatsava
Mohit Shrivatsava
author image
Mohit Shrivatsava

Mohit is a Python programmer with a keen interest in the field of information security. He has completed his Bachelor's degree in technology in computer science from Kurukshetra University, Kurukshetra, and a Master's in engineering (2012) in computer science from Thapar University, Patiala. He is a CEH, ECSA from EC-Council USA. He has worked in IBM, Teramatrix (Startup), and Sapient. He currently doing a Ph.D. from Thapar Institute of Engineering & Technology under Dr. Maninder Singh. He has published several articles in national and international magazines. He is the author of Python Penetration Testing Essentials, Python: Penetration Testing for Developers and Learn Python in 7 days, also by Packt. For more details on the author, you can check the following user name mohitraj.cs
Read more about Mohit Shrivatsava

Right arrow

Modifying the DOM in the RENDERER JavaScript file of the component bundle


The Lightning component framework takes care of rendering and re-rendering the DOM element when the values change. However, if you want to modify the DOM or take control of the DOM modification, you can do so in the render file. The following screenshot illustrates how you can find the RENDERER file for the component or the Lightning application:

To customize, modify, and interact with DOM elements, you must follow the following template in the RENDERER JavaScript file:

({
  // Your RENDERER method overrides go here
  render : function(component, helper) {
        var ret = this.superRender();
        // do custom rendering here
        return ret;
  },

    rerender : function(cmp, helper){
      this.superRerender();
      // do custom rerendering here
  },

    afterRender: function (component, helper) {
      this.superAfterRender();
      // interact with the DOM here
  },

    unrender: function () {
      this...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Salesforce Lightning Application Development
Published in: Jul 2018Publisher: PacktISBN-13: 9781787124677

Author (1)

author image
Mohit Shrivatsava

Mohit is a Python programmer with a keen interest in the field of information security. He has completed his Bachelor's degree in technology in computer science from Kurukshetra University, Kurukshetra, and a Master's in engineering (2012) in computer science from Thapar University, Patiala. He is a CEH, ECSA from EC-Council USA. He has worked in IBM, Teramatrix (Startup), and Sapient. He currently doing a Ph.D. from Thapar Institute of Engineering & Technology under Dr. Maninder Singh. He has published several articles in national and international magazines. He is the author of Python Penetration Testing Essentials, Python: Penetration Testing for Developers and Learn Python in 7 days, also by Packt. For more details on the author, you can check the following user name mohitraj.cs
Read more about Mohit Shrivatsava