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.
Unfortunately, activation email could not send to your email. Please try again.

Paging problem using ejGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

121802 Jan 26,2016 07:22 PM Jan 27,2016 01:54 AM JavaScript 1
loading
Tags: ejGrid
Myungjin Cho
Asked On January 26, 2016 07:22 PM

Hello syncfusion. 
Currently our team is migrating from our old solution to syncfusion ejGrid, and found a biblical issue.
Our paging methods are done in the back-end server, 
and the documents provided in your site do not have right paging methods which we use.
For example, if we have 100 rows of data then we have to add all of the 100 data into the ejGrid to show the paging.

According to your documents js/datamanager/paging, we've found out the paging using query could only be customized in the front-end 
Would there be a way to customize the paging in the back-end? 

Sellappandi Ramu [Syncfusion]
Replied On January 27, 2016 01:54 AM

Hi Maverickjin,

Thanks for contacting Syncfusion support,

Yes, we can customize paging functionality in back-end using Url Adaptor. URL Adaptor is feature in DataManager. It is used in Grid while we bound to DataManager as Datasource in Grid with Url adaptor enabled. While using URL Adaptor we need to perform operations in server side. The server operations are sorting, filtering, paging and server editing etc.,

Please refer to the code example, online help documentation for URL Adaptor, Datamanager and knowledge base documentation.

$(function () {

        var dataManger = ej.DataManager({

            url: "/Home/DataSource",

            adaptor: new ej.UrlAdaptor()

        });

        $("#Grid").ejGrid({

            dataSource: dataManger,

            allowPaging: true,

            columns: [

                        . . .

            ],

        });

    });


[Controller]

public ActionResult DataSource(DataManager dm)

        {

            var DataSource = new simpledbEntities2().Persons.ToList();

            DataResult result = new DataResult();

            DataOperations operation = new DataOperations();

            result.result = DataSource;

            result.count = result.result.AsQueryable().Count();

            if (dm.Skip > 0)

                result.result = operation.PerformSkip(result.result, dm.Skip);//To perform paging operation

            if (dm.Take > 0)

                result.result = operation.PerformTake(result.result, dm.Take);//To perform paging operation

            return Json(result, JsonRequestBehavior.AllowGet);
        }


Document for URL Adaptor: http://help.syncfusion.com/js/grid/editing#url-adaptor

Document for Datamanager: http://help.syncfusion.com/js/datamanager

KB: https://www.syncfusion.com/kb/4300/server-side-api-for-datamanager-operations

Regards,
Sellappandi R

CONFIRMATION

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.

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.

;