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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to use JayData as the DataSource instead of JSON data?

JayData can also be used as the DataSource instead of JSON. Refer to the JayData sources to do that. JayData is a unified data access library for JavaScript to work with online and offline data APIs like WebSQL, IndexedDB, Facebook, or OData. JayData source can be downloaded by clicking here. After the download, the scripts have to be referred in the HTML page. Refer to the following code example.


The field for the Grid has to be stored in a separate variable and then the data is stored in the variable by using the .save() method. Refer to the following code example.



// Fields for the grid data stored to a variable task.

        var Task = $data.define("Task", {

            OrderID: Number,

            CustomerID: String,

            Freight: Number


 // Data for the field in the Grid can be given by using the .save() method.


            OrderID: 123,

            CustomerID: 'BAS3000',

            Freight: 20



Then the data can be initialized in the Grid control by means of the .readall() method in the JayData that renders the data in the Grid.



Task.readAll().then(function (orderdetails) {


                dataSource: orderdetails,

                allowScrolling: true,

                allowPaging: true,

                columns: [

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

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

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






Article ID: Published Date: Last Revised Date: Platform: Control:
4045 02/16/2015 02/17/2015 JavaScript ejmGrid
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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