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.
Syncfusion Feedback

How to load data on-demand to Grid based on PageSize property of screen?

When the page size of the lightswitch screen is set, then ej grid will act as load at once i.e it will fetch data from database only once and act on cached data. But the user may like to retrieve the records from the database similar to lightswitch paging i.e perform on demand paging on the records in the database.

Solution:

We can achieve the above requirement by passing the service link to the ejDataManager and assign it as the grid dataSource. Using the DataManager, we can bind the service url as the grid dataSource by mentioning the link in the “url” property of the ejDataManager.

Thus based on the grid actions, the query is processed on the database and retrieved and bound to the ejGrid

We can set the default page size of the grid using the pageSettings.pageSize property of the Grid. Refer the below api documentation for more information on pageSize property.

http://help.syncfusion.com/js/api/ejgrid#members:pagesettings-pagesize

Example:

In the following example, we have assigned the service url as grid dataSource and have enabled paging to Grid.

Depending on the page size, Grid loads the data from dataSource and so you can able to retrieve all records from the dataSource via ej.DataManager.

JS:

 

Result:


http://www.syncfusion.com/downloads/support/directtrac/146286/1061002605_41ae6357.PNG 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
6311 02/15/2016 02/16/2017 LightSwitch HTML Grid
Tags:
Did you find this information helpful?
Comments
Parag Bagga Jan 02, 2017
how can i do custom paging in web forms with ej grid. Is there any event for handling the index
Reply
Parag Bagga Jan 03, 2017
Can you please tell me is there any paging event on server side i want to apply custom paging
Reply
Add Comment
You must log in to leave a comment

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