PDA

View Full Version : rowIndex is undefined in first addedd record



altermann
16 Nov 2009, 6:10 AM
Hi all.
sory for my English.

After adding new record in EditorGridPanel

store: new Ext.data.GroupingStore({
reader: new Ext.data.ArrayReader({idIndex : 0},
Ext.data.Record.create([{name:"name"},{name : "id"}]))

data: [],
sortInfo:{field: "id", direction: "ASC"},
groupField:"id"
})
like this


store.add(new Ext.data.Record({id:1, name:"1"}));

i've catch error in ie6 when i tried to do smth with this row (select for example)- "invalid argument".
;
so after performing this code


var v = Ext.getCmp("grid_id").view;
row = v.getRow(0);
var str = "";
for(o in row){
str += "["+o+"]; ";
}
str += ";_______"+typeof(row.rowIndex);
alert(str);

it shows that rowIndex undefined!
but it souldn't;

and when add 2 records at one time - both record have it property....

it's only ie6 bug when i turn to Ext js 3.0.

please tell me, why this happend?

altermann
18 Nov 2009, 10:51 PM
anybody?

altermann
19 Nov 2009, 3:45 AM
problem was in
ext all debug.js...

getTotalWidth : function(includeHidden){
if(!this.totalWidth){
this.totalWidth = 0;
for(var i = 0, len = this.config.length; i < len; i++){
if(includeHidden || !this.isHidden(i)){
this.totalWidth += this.getColumnWidth(i);
}
}
}
return this.totalWidth;
},


my column width's defined like width: "10%" (with % symbol).
getTotalWidth() returns string with %....
in ext js 2.2 this works properly(at least without errors);

thanks all

altermann
19 Nov 2009, 4:01 AM
so, i use forecefit of grid's layoutConfig.

Perez
9 Dec 2009, 9:19 PM
Thanks so much I was stuck on the same thing!