PDA

View Full Version : Why my row's number is limited in my Grid?



lchipot
20 Sep 2007, 1:16 AM
Hi everybody,

I don't know why, but I've got a list of 200 data.
I want to put it in my grid.

When I try it's only a blank grid.
But if I limit the number to 40 it's ok (less ok too) but more it's the same result than 200

Maybe I have to change a parameter? I don't know...

So if anybody know how to fix that,
You'll help me a lot!

Thanks in advance.................

Animal
20 Sep 2007, 1:24 AM
How can we guess what your code is doing?

lchipot
20 Sep 2007, 1:38 AM
In fact I create a data for the grid like that :

[[1,'A','B','C','D'],[2,'A','B','C','D'],[3,'A','B','C','D'],[4,'A','B','C','D']]

So until 40 no problem.. but more...

A part of code :


return {
init : function(){
showBtn = Ext.get('show-dialog-btn');
// attach to click event
showBtn.on('click', this.showDialog, this);
},


showDialog : function(){
if(!dialog){ // lazy initialize the dialog and only create it once

dialog = new Ext.LayoutDialog("hello-dlg", {
modal:true,
width:800,
height:600,
shadow:false,
minWidth:100,
minHeight:100,
proxyDrag: true,
center:{
titlebar: true
}
});
dialog.addKeyListener(27, dialog.hide, dialog);
dialog.addButton('Submit', this.doSubmit,this);
dialog.addButton('Close', dialog.hide, dialog);


var ds2 = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: '../EXTjs/listingServices.action'
}),
reader: new Ext.data.ArrayReader({id:0},
[{name:'Key'},
{name:'aaa',mapping:1},
{name:'bbb',mapping:2},
{name:'ccc',mapping:3},
{name:'ddd',mapping:4}
])

});
ds2.load();

var colModel2 = new Ext.grid.ColumnModel([
{header: "ID", width: 0, sortable: false, locked:false, dataIndex: 'Key'},
{header: "A", width: 0, sortable: false, locked:false, dataIndex: 'aaa'},
{header: "B", width: 0, sortable: false, locked:false, dataIndex: 'bbb'},
{header: "C", width: 400, sortable: true, locked:false, dataIndex: 'ccc'},
{header: "D", width: 400, sortable: true, locked:false, dataIndex: 'ddd'}

]);

var grid2 = new Ext.grid.Grid('grid2', {
ds: ds2,
cm: colModel2,
autoHeight: true
});

grid2.render();
var layout = dialog.getLayout();
layout.beginUpdate();
layout.add('center', new Ext.GridPanel(grid2,({title: 'Liste des services',fitContainer:true,closable:false})));

layout.endUpdate();

}

dialog.show();
},

doSubmit : function() {


dialog.hide();

}
};

Animal
20 Sep 2007, 1:42 AM
Stop in Firebug after the ds2.load() and see how many Records it has loaded into the Store.

lchipot
20 Sep 2007, 3:27 AM
When I've 40 entries, it's ok
After ds2.load i see totalLength=40

But even 41 entries, when I see totalLength... there's nothing!

Animal
20 Sep 2007, 3:31 AM
Did you debug it by stepping through the code like a good programmer?

Or do you just see that it doesn't work and give up?

lchipot
20 Sep 2007, 3:37 AM
I hope!

The problem is I'm new in Extjs,
so I try to do what I can as the best programmer I can be :D:D

I'll try something else and I come you back

lchipot
20 Sep 2007, 5:39 AM
Don't find anything :s

lchipot
21 Sep 2007, 2:17 AM
Hi! always the same problem... :(

I think there is maybe a place where I have to set the number of rows I want.
I looking for that file but I don't find

Looking on the Internet, don't find nothing

It's very strange : less than 40 rows (40 included) no problem but more I can see a blank grid and no error message!

Has anybody an idea?


Please!!!! :((:((:((

Animal
21 Sep 2007, 2:28 AM
So, when you are stepping through JsonReader.readRecords, it stopped the loop after 40?

Or what? What actual debugging activity did you perform?