PDA

View Full Version : load 60 000 rows in datagrid



maren
18 Aug 2009, 4:24 AM
hi,
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({
paramsAsHash:true,
root:'',
directFn: MenuDirectStore.loadExperienceData,
//idProperty:'id',

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 = {
width:700,
height:250,
autoScroll:true,
title:'List Menus',
store: ds,
columns:[{
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
}],
loadMask:true,
tbar: [
'Search: ', ' ',
new Ext.ux.form.SearchField({
store: ds,

width:320
})
],
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);



thanks

Condor
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.

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

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

maren
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

Condor
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!

maren
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

Condor
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?

maren
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

Animal
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.

maren
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.
.

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

maren
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

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

Animal
18 Aug 2009, 11:31 PM
Yes.

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