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

Server side processing

Thread ID:





132474 Sep 4,2017 03:59 PM UTC Sep 7,2017 06:12 AM UTC JavaScript 5
Tags: ejGrid
Asked On September 4, 2017 03:59 PM UTC

Hi, could you give an example of the server side processing? I have big data set I want to process all actions on the server. Under actions, I mean paging, sorting, and filtering. I created test grid, it's working, but it doesn't send any requests to the server when I click sort or anything else. I don't know how to trigger it. Could you give an example what will send to the server and how I need to prepare the response, something like this https://datatables.net/manual/server-side? Thank you
My test code:
        var dataManager2 = ej.DataManager({
url: "/attribute-set/grid",
crossDomain: true
dataManager2.adaptor = new ej.UrlAdaptor();
var query = new ej.Query().take(5);
var dataObj = dataManager2.executeQuery(query); //Request the webservice
dataObj.done(function (e) {
dataSource: e.result.results,
allowPaging: true,
allowSorting: true,
allowFiltering: true,
columns: ["ID", "CreatedAt", "DeletedAt", "UpdatedAt", "Name"],

Saravanan Arunachalam [Syncfusion]
Replied On September 5, 2017 04:40 AM UTC

Hi Vasily, 
Thanks for contacting Syncfusion’s support. 
We have analyzed your provided code and you have set the dataSource of Grid as return data (Json) instead of set the ejDataManager instance which is the cause of the issue. Please refer to the below code example to overcome your reported issue. 
$(function () { 
        var dataManager = ej.DataManager({ url: "/Home/DataSource", adaptor: new ej.UrlAdaptor() }); 
            dataSource: dataManager, 
            allowPaging: true, 
            filterSettings: {filterType: "menu"}, 
            allowFiltering: true, 
            allowSorting: true, 
            columns: [ 
                    { field: "OrderID", isPrimaryKey: true, headerText: "Order ID" }, 
                    { field: "EmployeeID", headerText: 'Employee ID' }, 
                    { field: "CustomerID", headerText: 'Customer ID' }, 
                    { field: "Freight", headerText: 'Freight', format: "{0:C}" }, 
                    { field: "ShipCity", headerText: 'Ship City' }, 
And also we have created a sample based on your requirement that can be downloaded from the below link. 
And also refer the following knowledge base document to know more about server side data operation. 
Saravanan A.       

Replied On September 5, 2017 02:07 PM UTC

Thank you, it's working. It will be good to have info about server response somewhere in the documentation. In my case, it didn't work because I didn't know how to prepare server answer.

Server response should be a JSON which contains two fields:

count - a total of found records
results - an array of your columns data

Is it right?

Saravanan Arunachalam [Syncfusion]
Replied On September 6, 2017 05:54 AM UTC

Hi Vasily, 
Yes, we should return the data from server like object (which contains result and count) while using UrlAdaptor (DataManager instance) as a dataSource of Grid control. 
Saravanan A. 

Replied On September 6, 2017 11:59 AM UTC

Ok, thank you

Saravanan Arunachalam [Syncfusion]
Replied On September 7, 2017 06:12 AM UTC

Hi Vasily,  
Thanks for your update.            
We are happy that the provided information helped you. 
Saravanan A. 


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

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