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.

Dynamically change grid pageSize

Thread ID:

Created:

Updated:

Platform:

Replies:

121326 Dec 1,2015 10:59 PM Oct 30,2017 11:33 AM JavaScript 7
loading
Tags: ejGrid
Toi Wright
Asked On December 1, 2015 10:59 PM

I have a grid that I would like to allow the user to select the page size used by the pager.

var gridObj = $("#grid").ejGrid("instance");
gridObj.option({ "pageSettings": { "pageSize": args } });
This code works for the first page. But, when I use the try to go to page 2 it displays all of the records in the model. Is this a known bug? Is there a work around?
This is my DataManager:
var dm = ej.DataManager({
                   url: "FetchData",
                   adaptor: new ej.UrlAdaptor(),
                   offline: true
               });

Sellappandi Ramu [Syncfusion]
Replied On December 7, 2015 07:25 AM

Hi Toi,

Thanks for contacting Syncfusion support.

While using offline property as true in datamanager, the server side request only once and further data manipulation operation can be done at client-side itself. So all the data will  be in data source model.

Please refer to the online help documentation for offline property,

http://help.syncfusion.com/aspnetmvc/datamanager/data-binding#offline-mode

Url Adaptor of the DataManager can be used when you are required to use remote service to retrieve data wen perform the paging operation or CRUD operation in grid.

Please refer to the online help documentation for URL adaptor,

http://help.syncfusion.com/aspnetmvc/datamanager/data-adaptors#url-adaptor

We suggest you to remove the offline property from datamanager to perform paging operation in server request.

Please refer to the below Knowledge Base document for server side operation, 

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

Regards,
Sellappandi R

Chris Marinacci
Replied On October 25, 2017 01:13 PM

I just ran into this exact same problem, without explicitly using a DataManager. I change the page size from 10 to 25 on the first page and the code works, but when I go to the second page many more than 25 records are displayed.

The issue is that the page size is set to a particular value, but the grid doesn't reflect that value when it displays data. It's a bug in the way that the grid displays data after the page size is changed.


Thavasianand Sankaranarayanan [Syncfusion]
Replied On October 26, 2017 12:05 PM

Hi Chris, 
 
Thanks for contacting Syncfusion support. 
 
We have analyzed your query and we are unable to reproduce the reported issue ”Changing the page size and move to next page returns all records in Grid” from our end. 
 
We have prepared a sample and it can be downloadable from the below location. 
 
 
Refer the below screen shot that after we move to the next page only 25 records get bound to the Grid. 
 
 
 
Please provide the following details for better assistance. 
 
  1. Share screen shot or video demonstration of the issue.
  2. Share the exact scenario or proper replication procedure to reproduce the issue.
  3. Share the full Grid code example both server and client side.
  4. Essential Studio version details.
  5. If possible share the sample or reproduce the issue in the attached sample.
 
Regards, 
Thavasianand S. 


Chris Marinacci
Replied On October 26, 2017 02:07 PM

Hi Thavasianand,

The sample code that you sent doesn't compile. It has hardcoded references to three Syncfusion DLLs that don't exist in the ZIP file, and a reference to System.Data.SqlServerCe that cannot be resolved. Can you create a sample that uses all NuGet packages?
Thanks,
Chris

Thavasianand Sankaranarayanan [Syncfusion]
Replied On October 27, 2017 11:40 AM

Hi Chris, 
 
We have modified the sample and it can be downloadable from the below location. 
 
 
Regards, 
Thavasianand S. 


Chris Marinacci
Replied On October 27, 2017 12:33 PM

Hi Thavasianand,

I had to update the database to a more recent version.

There's still an unresolved reference to System.Data.SqlServerCe, which I resolved by installing a NuGet package (System.Data.SqlServerCe_unofficial).

However, when I run the program (both before and after installing this package) I get an exception:

Server Error in '/' Application.


Specified argument was out of the range of valid values.
Parameter name: site


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: site

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: site]
   System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +280

[HttpException (0x80004005): Specified argument was out of the range of valid values.
Parameter name: site]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10042604
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Thanks,

Chris


Thavasianand Sankaranarayanan [Syncfusion]
Replied On October 30, 2017 11:33 AM

Hi Toi, 

We have prepared a video demonstration that we are unable to reproduce the reported issue. 


Please provide the following details for better assistance. 

  1. Share screen shot or video demonstration of the issue.
  2. Exact scenario or proper replication procedure.
  3. Essential studio version details.

Regards, 
Thavasianand S. 


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.

;