javist
11 Jun 2009, 10:36 PM
I tested the following tree, found that it didn't work in IE7 and IE8, but work well in FF3.
Could anyone give me suggestion or quick fix for it?
Thanks.
var json = [
{"text" : "Audi", "id" : 100, "leaf" : false, "cls" : "folder", "children" : [
{"text" : "A3", "id" : 1000, "leaf" : false, "cls" : "folder",expanded : true, "children" :
[ {"text" : "Fuel Economy", "id" : "100000", "leaf" : true, "cls" : "file"},
{"text" : "Invoice", "id" : "100001", "leaf" : true, "cls" : "file"},
{"text" : "MSRP", "id" : "100002", "leaf" : true, "cls" : "file"},
{"text" : "Options", "id" : "100003", "leaf" : true, "cls" : "file"},
{"text" : "Specifications", "id" : "100004", "leaf" : true, "cls" : "file"}
]
},
{"text" : "A4", "id" : 2000, "leaf" : false, "cls" : "folder", "children" :
[ {"text" : "Fuel Economy", "id" : "200000", "leaf" : true, "cls" : "file"},
{"text" : "Invoice", "id" : "200001", "leaf" : true, "cls" : "file"},
{"text" : "MSRP", "id" : "200002", "leaf" : true, "cls" : "file"},
{"text" : "Options", "id" : "200003", "leaf" : true, "cls" : "file"},
{"text" : "Specifications", "id" : "200004", "leaf" : true, "cls" : "file"}
]
},
]}
];
var tree = new Ext.tree.TreePanel( {
animate:true,
enableDD:false,
loader: new Ext.tree.TreeLoader(), // Note: no dataurl, register a TreeLoader to make use of createNode()
lines: true,
renderTo: document.body,
root: new Ext.tree.AsyncTreeNode({
text: 'Autos',
draggable:false,
id:'source',
children: json
}),
rootVisible:true
});
Could anyone give me suggestion or quick fix for it?
Thanks.
var json = [
{"text" : "Audi", "id" : 100, "leaf" : false, "cls" : "folder", "children" : [
{"text" : "A3", "id" : 1000, "leaf" : false, "cls" : "folder",expanded : true, "children" :
[ {"text" : "Fuel Economy", "id" : "100000", "leaf" : true, "cls" : "file"},
{"text" : "Invoice", "id" : "100001", "leaf" : true, "cls" : "file"},
{"text" : "MSRP", "id" : "100002", "leaf" : true, "cls" : "file"},
{"text" : "Options", "id" : "100003", "leaf" : true, "cls" : "file"},
{"text" : "Specifications", "id" : "100004", "leaf" : true, "cls" : "file"}
]
},
{"text" : "A4", "id" : 2000, "leaf" : false, "cls" : "folder", "children" :
[ {"text" : "Fuel Economy", "id" : "200000", "leaf" : true, "cls" : "file"},
{"text" : "Invoice", "id" : "200001", "leaf" : true, "cls" : "file"},
{"text" : "MSRP", "id" : "200002", "leaf" : true, "cls" : "file"},
{"text" : "Options", "id" : "200003", "leaf" : true, "cls" : "file"},
{"text" : "Specifications", "id" : "200004", "leaf" : true, "cls" : "file"}
]
},
]}
];
var tree = new Ext.tree.TreePanel( {
animate:true,
enableDD:false,
loader: new Ext.tree.TreeLoader(), // Note: no dataurl, register a TreeLoader to make use of createNode()
lines: true,
renderTo: document.body,
root: new Ext.tree.AsyncTreeNode({
text: 'Autos',
draggable:false,
id:'source',
children: json
}),
rootVisible:true
});