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

Loading data in ejGrid

Thread ID:





122146 Feb 20,2016 12:43 AM UTC Apr 13,2016 10:33 AM UTC JavaScript 3
Tags: ejGrid
Alirio Castro
Asked On February 20, 2016 12:43 AM UTC


I'm new developing under Syncfusion's Javascript controls.
This is my code for ejGrid object.

          dataSource: dataManger,
          allowPaging: true,
          allowReordering: true,
          allowResizeToFit: true,
          allowSelection: false,
          pageSettings: { pageSize: 20 },
          columns: [
              { field: "Id", isPrimaryKey: true, type: "number", visible:false },
              { field: "RifOCedula", headerText: "RIF o Cédula", width: 100 },
              { field: "RazonSocialONombreYApellido", headerText: "Descripción", width: 100 },
              { field: "Direccion", headerText: "Dirección" },
              { field: "Email", headerText: "Correo Electrónico" }
          actionBegin: function (args) {
              args.model.query.addParams("searchValue", $("#searchValueText").val());
This is the response from the server:
This is the Console log (ej.grid.all.js (line 38495, col 47) using only ejGrid script non-minified:
TypeError: this.model.currentViewData is undefined
...s._dataSource() == null || this._dataSource().length == 0 || this.model.currentV...
If the initial response contains data, there is not error.

Thank you for your attention and support,
Alirio Castro

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On February 22, 2016 09:58 AM UTC

Hi Alirio,

We are able to reproduce the reported issue at our end after binding the empty dataSource for the Grid via OdataV4Adaptor. We have created a new support incident under your account to track the issue “OdataV4Adaptor throws an script error after returning empty dataSource from server” and its status. Please log on to our support website to check for further updates.


To work around this issue, create customAdaptor (extend the ej.OdataV4Adaptor) and return the processResponse function as result/count pair. Refer to the following code example.

<div id="Grid"></div>

<script type="text/javascript">

    $(function () {

        var customAdaptor = new ej.ODataV4Adaptor().extend({

            processResponse: function (data, ds, query, xhr, request, changes) {

                result = this.base.processResponse.apply(this, [data, ds, query, xhr, request, changes]);

                if (ej.isNullOrUndefined(result.count)) {

                    result.result = [];

                    result.count = result.result.length;


                return result;



        var dataManager = new ej.DataManager({

            url: "/Odata/Orders/", adaptor: new customAdaptor()



            allowPaging: true,

            dataSource: dataManager,

              . . . . . .



We have prepared a sample that can be downloaded from the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/122146/ze/EJGrid1022136248

Seeni Sakthi Kumar S.

Replied On April 12, 2016 08:23 AM UTC

Often this._dataSource() has no property length, while this._dataSource has. I did a quick test with url & odatav4 adaptor, so I cant provide a complete example.

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On April 13, 2016 10:33 AM UTC

Hi Alirio,

We have already created a new support incident under your account to track the issue “OdataV4Adaptor throws an script error after returning empty dataSource from server”. It has been fixed and included in the Essential Studio Volume 1, 2016 v14.1.0.41. Please log on to our support website and check it.


And we suggest to update to our latest version Essential Studio Volume 1, 2016 (v14.1.0.41) and is available for download under the following link:

1)      Install Essential Studio Essential Studio Volume 1, 2016 (v14.1.0.41) from the following link.

Essential Studio: http://www.syncfusion.com/forums/123633/essential-studio-2016-volume-1-release-v14-1-0-41-is-available-for-download

2)      Replace the Syncfusion dlls, scripts, CSS in your project from the following location.

Scripts and Css:  (Installed Location)\Syncfusion\Essential Studio\\JavaScript\assets

Note: Clear browser cache and bin folders, after upgrading to the latest version to avoid the accidental reference of old scripts, CSS and dlls.

If you are still facing any difficulty, please provide the following information to analyze the issue and provide you solution as early as possible.

1)      Code example of Grid

2)      Stack trace of browser console (if any error)

3)      Exact Replication procedure for the issue

We have also prepared a sample with the latest version that can be referred from the following jsPlayground.


Seeni Sakthi Kumar S.


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

or the page will be automatically redirected to 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