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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

How to set the data source for the Grid Control ?

Platform: jQuery |
Control: ejmGrid
Tags: grid, mobile

Grid’s data source can be referred from the locally stored data source. Data for the Grid is stored in local database window.gridData. You can refer to the following code examples.



            // the datasource "window.gridData" is defined for grid

         window.gridData = [

             { "OrderID": 10001, "CustomerID": 101, "Freight": "Chicago" },

             { "OrderID": 10002, "CustomerID": 102, "Freight": "San Francisco" },

             { "OrderID": 10003, "CustomerID": 103, "Freight": "New York" },



Create a div element to initialize the Grid control as in the following code example.

Locally stored values from the window.gridData can be passed as a data source to the Grid on initialization. You can refer to the following code example.



$(function () {


                dataSource: window.gridData, //Datasource referred here

                columns: [

                         { field: "OrderID", headerText: "Order ID" },

                         { field: "CustomerID", headerText: "Customer ID" },

                         { field: "Freight", headerText: "Freight" }


                actionComplete: function () { $("#samplescroll").ejmScrollPanel("refresh"); }




You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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