PDA

View Full Version : works well in FF and IE7 , but get wrong in IE6



healdream
22 Nov 2007, 6:28 PM
here is my entire code


Ext.onReady(function(){
var g_data = [
[1,'我是名称1','我是地址1'],
[3,'我是名称2','我是地址2'],
[4,'我是名称3','我是地址3'],
[6,'我是名称4','我是地址4']
];
var store = new Ext.data.SimpleStore({
fields:[
{name:'test',type:'int'},
{name:'title'},
{name:'address'}
]
});
store.loadData(g_data);
var grid = new Ext.grid.GridPanel({
store:store,
width:800,
autoExpandColumn:'address',
autoHeight:true,
stripeRows:true,
border:true,
columns: [
{header: 'id', dataIndex: 'test',width:200},
{header: 'title', dataIndex: 'title',width:200},
{id:'address', header: 'address', dataIndex: 'address',width:300}
],
title:'受注列表'
});
grid.render('info_list');
});


and in IE6 it looks like
http://healdream.googlepages.com/ie6.gif

tryanDLS
22 Nov 2007, 6:32 PM
Try calling loadData after render, not before.

healdream
22 Nov 2007, 6:34 PM
get the same result :(

tryanDLS
22 Nov 2007, 8:09 PM
Sorry, the order doesn't matter. Do you have a doctype in your HTML? Also, the grid should have a height specified.

healdream
22 Nov 2007, 8:17 PM
thanks! tryanDLS , the doctype sucks!
it took me nearly 2 hours , and found out the reason is the doctype , and I delete it , everything goes ok!