We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Triggering a load complete event in EJ2

Thread ID:

Created:

Updated:

Platform:

Replies:

149835 Dec 11,2019 09:54 AM UTC Dec 13,2019 05:38 AM UTC JavaScript - EJ 2 3
loading
Tags: Grid
vipin
Asked On December 11, 2019 09:54 AM UTC

I have created a grid control using syncfusion EJ2 javascript. I want to get details of the following events 1) Load complete event.ie all grid components are loaded completely into the DOM. 2) When the grid is refreshed. Please provide the details regarding these events with code samples.

Pavithra Subramaniyam [Syncfusion]
Replied On December 11, 2019 10:15 AM UTC

Hi vipin, 
 
Greetings from  Syncfusion. 
 
Query#1: Load complete event.ie all grid components are loaded completely into the DOM. 
 
In EJ2 Grid component, “created” event will be triggered when the component is created and “dataBound” event will triggered after the data is bound to the Grid. In this event all the Grid element will be loaded on DOM. 
 
 
Query#2: When the grid is refreshed.  
 
When the Grid is refreshed the “actionBegin” and “actionComplete” event will be triggered with requestType “refresh”. Also “dataBound” event will be triggered for every refresh. 
 
 
Please get back to us if you need any further assistance on this. 
 
Regards,  
Pavithra S.  


vipin
Replied On December 12, 2019 12:44 PM UTC

Thanks for your response. I want to know the event when a template in rendered. There is an event that exists in the ej1 version. 

 ej.template.render = function (self, selector, data, index) {

                   };

I want the equivalent event that exists in the ej2.

Pavithra Subramaniyam [Syncfusion]
Replied On December 13, 2019 05:38 AM UTC

Hi Vipin,  
Query :  I want to know the event when a template in rendered. There is an event that exists in the ej1 version.  
 
In EJ2 there is no specific event for template render like in EJ1. But you can get template data in the queryCellInfo event itself ( This will be triggered before the cell element is appended to the Grid element ). Please refer the below code example and sample for more information.  
 
 
Index.js 
var grid = new ej.grids.Grid({ 
    dataSource: data, 
    columns: [ 
        { field: 'OrderID', headerText: 'Order ID', width: 120 }, 
        { field: 'CustomerID', headerText: 'CustomerID', textAlign: 'Right', width: 125 }, 
        { 
            headerText: 'Address', textAlign: 'Center', 
            template: '#template', width: 150 
        } 
    ], 
    queryCellInfo : function(args){ 
 
      if(args.column.headerText == 'Address'){ 
 
          console.log(args); 
      } 
    },     
    height: 315 
}); 
grid.appendTo('#Grid'); 
 
 
index.html 
 
<div id="container"> 
                <script id="template" type="text/x-template"> 
                        "${ShipCountry}-${ShipAddress}" 
                </script> 
            <div id="Grid"></div>         
        </div> 
 
 
 
Please get back to us if you need further assistance. 
 
Regards,   
Pavithra S  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon