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.
Unfortunately, activation email could not send to your email. Please try again.

How to select a row in a grid, on load of grid data.

Thread ID:

Created:

Updated:

Platform:

Replies:

131708 Jul 24,2017 11:17 AM Jul 25,2017 06:23 AM JavaScript 1
loading
Tags: ejGrid
Surya Narayana Murthy
Asked On July 24, 2017 11:17 AM

Hi,

How can i select a row in a grid on onload of grid data and how to trigger the click event after row selection.

Is there any way to store grid layout info and set the stored layout on onload of the data?

Thanks 
Surya

Mani Sankar Durai [Syncfusion]
Replied On July 25, 2017 06:23 AM

Hi Surya, 

Thanks for contacting Syncfusion support. 

Query 1: How can i select a row in a grid on onload of grid data and how to trigger the click event after row selection.  
          We have analyzed your query and to select the rows on load time we suggest you to use selectRows method inside the dataBound event of grid or using selectedRowIndex property in grid. 
Refer the code example 
  $("#Grid").ejGrid({ 
                // the datasource "window.gridData" is referred from jsondata.min.js 
                dataSource: window.gridData, 
                allowPaging:true, 
                columns: [ 
... 
                ], 
                dataBound: function (args) { 
                    var grid = $("#Grid").ejGrid("instance"); 
                    grid.selectRows(1); 
                }, 
                
            }); 

Refer the documentation link 


Also to trigger the click event after the row selection in grid we suggest you to use the following events in grid. 
recordClick: triggers when record is clicked in grid. 
rowSelected: triggers after rows selected in grid. 
Refer the documentation link. 


Query 2: Is there any way to store grid layout info and set the stored layout on onload of the data? 
 
We suspect that you would like to maintain the grid state even if it refresh. So we suggest you to use enablePersistence property in grid which helps to maintain the grid event the page gets refreshed. 
Refer the documentation link. 

Also we have documented a knowledge base by saving the model values in database and it can be available from the below link. 



Please let us know if you need further assistance 

Regards, 
Manisankar Durai. 
 



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.

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.

;