Hi Rainier,
Thanks for using Syncfusion Products.
Query 1: “Remote binding with server-side paging”
We would like to let you know that when we use Remote binding with server-side paging, we need to return the data as JSON and the JSON object must contain field name as “result” with its value as dataSource and one more field name as “count” with its value as dataSource total records count.
But from your code snippets we found that your web services return a JSON-serialised object as “data” and “total” and we have created a custom Adaptor of DataManager to bind data which are returned as “data” and “total”. And in the Grid “load” event we have assigned the Custom Adaptor to Grid DataSource property. Please refer the following code snippets.
var customAdaptor = new ej.UrlAdaptor().extend({//creating custom adaptor by extending UrlAdaptor of DataManager processResponse: function (data, ds, query, xhr, request, changes) {
var pvt = request.ejPvtData || {}; data.result = data.data; // converting data and total values as "result" and "count" for further grid processing data.count = data.total; ... return data; } });
$("#Grid").ejGrid({ // the datasource "window.gridData" is referred from jsondata.min.js dataSource: ej.DataManager({url: "Home/Datasource", ..}) ... load:'loadHandler' });
function loadHandler(args) { this.model.dataSource.adaptor
= new customAdaptor() |
Query 2: “read some actual documentation”
Please refer the following DataManager Custom Adaptor documentation for further reference.
http://help.syncfusion.com/ug/js/documents/conceptsandfeatures10.htm
Query 3: “handle errors”
We would like to let you know that using “validationRules” property of Grid Columns we can add validation to the Grid columns. Please refer the following code snippets.
$("#Grid").ejGrid({ { field: "OrderID", isPrimaryKey: true, headerText: "Order ID", textAlign: ej.TextAlign.Right, validationRules: { required: true, number: true }, width: 90 }, { field: "CustomerID",
headerText: 'Customer ID', validationRules: {
required: true, minlength: 3 }, width:
90 }, }) |
Please refer the following documentation for further details about Validation in Grid.
http://help.syncfusion.com/ug/js/documents/validation.htm
We also would like to let you know that the “validationRules” property performs client-side validation and if we misunderstood your requirement or if you need server-side validation then please get back to us so that we could provide a response as early as possible.
For your convenience we have created a sample and the same can be downloaded from below link
Sample: http://www.syncfusion.com/downloads/support/directtrac/131546/EJGrid-1657659330.zip
Please let us know if you have any queries.
Regards,
Alan Sangeeth S
Hi
Rainier,
Thanks
for your update.
Query: The client/server code seem to be
closely coupled as opposed to Ext JS
We have consider
your requirement as feature request and we have created a separate incident “#132631” to follow up the feature for
better follow up. We will update the response for other queries in the above mentioned
incident.
Please let us
know if you have any concerns.
Regards,
Ajith R