Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

Following an example - jqGrid rows

I am trying to understand how jqGrid handles large amount of data.

Please scroll down on this example to Adding Action Method GetCustomer

jqGrid example

In my project, we have a grid that brings back 3,000,000 rows and it's very slow. It uses Grid.MVC. Only some internal users bring back this much data. Our customers who use the application don't.

I want to tune the grid and maybe use jqGrid.  I looked at the code and it brings back 3,000,000 rows upfront.

How does jqGrid work? I've been looking at lots of examples and can't figre it out.
SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Camillia

ASKER

your issue is ONLY on your server which MUST handle the number of rows to retrieve AND from which line

This is what I don't understand. Suppose page loads, and there are 3,000,000 rows for the specific user.

I don't bring 3,000,000 rows initially, correct? if "page" is set to 50 rows per page...I'll bring back only 50 rows initially?

If I understand this part... the high overview of how it should work.... I can mock up a page in the project and see how it works.
Is this correct?

1. There are 3,000,000 rows
2. Page is set to 50 rows per page
3. Page loads
4. I query the database and only bring back 50 rows
5. User sorts by whatever column OR clicks on page 2
6. These 2 line calculate what to bring back .. if user is sorting or if paging

int pageIndex = Convert.ToInt32(page) - 1;  
         int pageSize = rows;

Open in new window



The previous developer quit and when i step thru the code...it's Grid.Mvc....it looks like with each sort or page switch, it goes and gets all the rows. Initially...it gets the 3,000,000 rows and the page just sits there.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, Julian. Let me take a closer look at the example.