PDA

View Full Version : Best approach to show data



webfriend13
15 Mar 2012, 12:08 AM
Hi All,

I am using ExtJs 4.07 framework. I have a grid from which user can select multiple users. The page also have a button. Clicking this button send a request to server and I pass the list of users. In return I get list of users (user name is shown as columns) & various products are shown as rows. The table basically list how many times the given user has ordered for this product.



Product
User1
User2
User3
User4
User5
.
user N


A
3
7
11
15
19
23
27


B
4
7
10
13
16
19
22


C
5
7
9
11
13
15
17



Important point to remember:
System can return 1-2 million or records.

My question:
1) How to design the store and model as I don't know the number of columns that can be returned.
2) How to assign this store to the grid? (I cannot specify the columns for the grid at design time).
3) I am thinking of using infinite scrolling gird. is it a good idea or I should use paging in the grid?
4) Any other design consideration I should take into account?
5) How many records can the store hold (considering I can have 50 columns)?
Kindly suggest

Erikvip
15 Mar 2012, 12:38 AM
1) How to design the store and model as I don't know the number of columns that can be returned.

You can return an array in the result, then when the store loads, build the columns. Or using Ext.Direct, call a server side method to check the possible users before creating the grid, then define the columns after you have a list.

2) How to assign this store to the grid?

Use a model and Ext.Direct

3) I am thinking of using infinite scrolling gird. is it a good idea or I should use paging in the grid?

No. use paging.

4) Any other design consideration I should take into account?

I'd use Ext.Direct for this solution, if you're not already. Also, what about just using the grouping feature -

http://dev.sencha.com/deploy/ext-4.0.1/examples/grid/groupgrid.html

webfriend13
15 Mar 2012, 12:57 AM
Hi Erik,

Thank you for quick reply. I cannot use paging as I am using SQL server analysis service which as far as i know does not support paging or atleast it is not easy to implement.

I was hoping for some code sample or link which will tell me how to achieve this.
To define the store, even If I consider using model, how will i supply the field name. Even i am not aware of them until I click on button.

Is there any way to tell store get only 1000 record first then with the help of some flag query next 1000 records?



1) How to design the store and model as I don't know the number of columns that can be returned.

You can return an array in the result, then when the store loads, build the columns. Or using Ext.Direct, call a server side method to check the possible users before creating the grid, then define the columns after you have a list.

2) How to assign this store to the grid?

Use a model and Ext.Direct

3) I am thinking of using infinite scrolling gird. is it a good idea or I should use paging in the grid?

No. use paging.

4) Any other design consideration I should take into account?

I'd use Ext.Direct for this solution, if you're not already. Also, what about just using the grouping feature -

http://dev.sencha.com/deploy/ext-4.0.1/examples/grid/groupgrid.html

Erikvip
15 Mar 2012, 1:15 AM
Is there any way to tell store get only 1000 record first then with the help of some flag query next 1000 records?

Yes, it's called paging...you pass the LIMIT and OFFSET params from the grid pager into the SQL query...

With a large amount of columns, the grid will look terrible & probably be unreadable. You should rethink your GUI... use a grouping grid, or a chart, or only show one user at time.