Client side paging tied to a RESTful API
var dataManger = ej.DataManager({
url: "/read",
updateUrl: '/update',
adaptor: 'UrlAdaptor',
});
It tries to do server side paging and sends a POST request with the skips and takes to the server and won't do client side paging. If I add an offline:true:
var dataManger = ej.DataManager({
url: "/read",
updateUrl: '/update',
adaptor: 'UrlAdaptor',
offline: true
});
It will do a GET request and client side paging but when I try to update a cell it will never make an update call to the server.
Suggestions?
Thanks for using Syncfusion products.
We have analyzed your requirement and we can achieve your requirement with the help of RemoteSave Adaptor of the ejDataManager. The remoteSaveAdaptor will help to bind the local data to the grid and do all the grid actions such as sorting, paging, grouping etc. at the client side itself except that the CRUD operations alone will be performed at the server side.
The remoteSave adaptor can be used as follows.
<script type="text/javascript"> //Getting all the data from the server var promise = ej.DataManager({ url: "/read", offline: true }); promise.ready.done(function (e) { $("#Grid").ejGrid({ /* Provided the e.result to `json` property * Specified the adaptor as ej.remoteSaveAdaptor() * Now except CRUD, all actions will be performed at client side. */ dataSource: ej.DataManager({ json: e.result, updateUrl: '/update', adaptor: ej.remoteSaveAdaptor() }), columns: [ ......... ] }) }); |
Now all the grid actions will be performed at the client side without querying server except the CRUD operations. Please refer the below help link for document on remote save adaptor and other available adaptors in ejDataManager.
http://help.syncfusion.com/ug/js/index.html#!Documents/dataadaptors.htm
Please let us know if you have any queries.
Regards,
Madhu Sudhanan. P
Uncaught TypeError: Cannot read property 'apply' of undefinedi(anonymous function)firefireWith(anonymous function)(anonymous function)(anonymous function)firefireWithdone(anonymous function)
var promise = ej.DataManager({url: INSTANCE_URL + '/api/v2/db/_table/', offline: true,
adaptor: new syncfusionGridAdapter(),
headers: [{"X-DreamFactory-API-Key": APP_API_KEY,"X-DreamFactory-Session-Token": token}]});
promise.ready.done(function (e) {
$("#Grid").ejGrid({
dataSource: ej.DataManager({ json: e.result, adaptor: ej.remoteSaveAdaptor() }),
columns: ["id","last_name","first_name"
]
})
});
- 3 Replies
- 4 Participants
-
MD Miles Douglas
- May 1, 2015 10:00 PM UTC
- Nov 10, 2016 01:18 PM UTC