View Full Version : load 60 000 rows in datagrid

18 Aug 2009, 4:24 AM
i try to load 65000 rows in a datagrid but it doestn't work

although the same code work perfectly with another store (675 rows)

Sphere.mygrid = Ext.extend(Ext.grid.GridPanel, {

initComponent: function() {
var ds = new Ext.ux.data.PagingDirectStore({
directFn: MenuDirectStore.loadExperienceData,

fields: [
{name: 'id' },
{name: 'parentId'},
{name: 'value'}
paramOrder: ['value'],
baseParams: {value:''},

autoLoad: {params: {value:'', start: 0, limit: 10}}
// ds.load({params: {value:'', start: 0, limit: 10}});

var pagingbar= new Ext.PagingToolbar({
pageSize: 10,
store: ds,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No data to display"

var config = {
title:'List Menus',
store: ds,
id: 'menu_id', // id assigned so we can apply custom css (e.g. .x-grid-col-topic b { color:#333 })
header: "menu_id",
dataIndex: 'id',
width: 100

// sortable: true
header: "value",
dataIndex: 'value',
width: 300
//align: 'left'
//sortable: true
tbar: [
'Search: ', ' ',
new Ext.ux.form.SearchField({
store: ds,

bbar: pagingbar
Ext.apply(this, Ext.apply(this.initialConfig, config));

Sphere.mygrid.superclass.initComponent.apply(this, arguments);

/* afterRender: function() {
this.getStore().load({params: {value:'', start: 0, limit: 10}});

Sphere.mygrid.superclass.afterRender.apply(this, arguments);
onRender: function() {
this.getStore().load({params: {value:'', start: 0, limit: 10}});

Sphere.mygrid.superclass.onRender.apply(this, arguments);

Ext.reg('mygrid', Sphere.mygrid);

//////////List menu Panel////////////////////////////

Sphere.ListMenuPanel = Ext.extend(Ext.Panel, {

initComponent : function() {
Ext.apply(this, {
items : [{xtype: 'mygrid'}]
Sphere.ListMenuPanel.superclass.initComponent.apply(this, arguments);
Ext.reg('ListMenuPanel', Sphere.ListMenuPanel);


18 Aug 2009, 4:28 AM
Define "doestn't work"...

65000 records is way to much for a grid to display, but I see you are already using paging, so this should work fine.

18 Aug 2009, 4:32 AM
i mean that no data in datagrid

18 Aug 2009, 4:33 AM
Does your server return the correct paged data?

18 Aug 2009, 4:36 AM
yes because when i test the search field ,it return data
but on first loading i doesn't have data in data grid

18 Aug 2009, 4:42 AM
Does your server return the correct records for the first time the grid is shown?

ps. You should NOT set autoScroll:true in a grid!

18 Aug 2009, 4:46 AM
the grid is shown but without records in first time
i attached two files that demonstrate my problem in the last reply

18 Aug 2009, 4:50 AM
But did you check what request is send to what response is received from the server for the first grid display?

18 Aug 2009, 5:07 AM
i check it but grid doesn't receive any records in the first time .
because I can receive record in data grid when i test the search field,the problem is that datagrid can't display to much data in first time

18 Aug 2009, 5:13 AM
Your server must only send back the data requested.

Not the full dataset.

Just the single page specified by the start and limit parameters.

18 Aug 2009, 5:33 AM
I know this but my problem is how to display the single page specified by the start and limit parameters
in the datagrid, i try the same code with a another store that contains 675 rows and it work perfectly Mr Animal.

18 Aug 2009, 5:37 AM
show the json returned from server

18 Aug 2009, 10:54 PM
it make so much time to load ,
after loading ,it doesn't display anythings
may be because it find so much data to load

18 Aug 2009, 11:31 PM
But you are sending a limit parameter of 10. Your server should only be returning 10 records!

18 Aug 2009, 11:31 PM

Because we we are desperately trying to tell you. The server must only return the page you are requesting