$("#clientesGrid").ejGrid({ 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:
{"$id":"1","value":[],"@odata.count":0}
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
<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() }); $("#Grid").ejGrid({ allowPaging: true, dataSource: dataManager, . . . . . . }); }); |
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\14.1.0.41\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.
http://jsplayground.syncfusion.com/dkom12ic
Regards,
Seeni Sakthi Kumar S.