本人初学ExtJs,在实现一个在TabPanel中嵌入一个Panel的时候,一直显示不出来。
以下是部分代码: var docListSearchStore = ed.common.getStore({
//something
autoLoad: true
});
var searchForm = new Ext.form.Panel({
//something
items : {
store : docListSearchStore,
},
renderTo: Ext.getBody()
}); var treeStore = Ext.create('Ext.data.TreeStore',{
root:{
expanded:true,
text:'Root',
children:[
{text:'p1',leaf:true},
{
text:'p2',
leaf:false,
expanded:false,
children:[
{text:'p2-1',leaf:true},
{
text:'p2-2',
leaf:true,
href:'treegrid.html',
hrefTarget:'_self'
}
]
}
]
}
});var tree = new Ext.tree.Panel({
id : 'tree',
width:270,
height:400,
title:ed.'Test2',
renderTo:Ext.getBody(),
autoScroll : true,
iconCls : 'tabHierarchy',
enableDD : false,
store:treeStore,
rootVisible:false,
useArrows:true,
columns: [{
text: 'haha',
width: 270,
dataIndex: 'DOC_UNIT_ID',
sortable: true
}]
}); var docTabPanel = new Ext.tab.Panel({
x : 0,
y : 0,
width:270,
height:400,
activeTab : 'tree',
id : 'docTabPanel',
items :[{
title: 'tree',
html: tree
}, {
title: 'searchPanel',
html: searchPanel
],
renderTo: Ext.getBody()
});
以上是我的部分代码,可是这段代码却一直运行不起来,不能够正常显示,不能够正常的加载到tabPanel里,不知道因为什么原因导致的,请高手帮我指点一下,先谢谢了extjsjavascriptautoload
以下是部分代码: var docListSearchStore = ed.common.getStore({
//something
autoLoad: true
});
var searchForm = new Ext.form.Panel({
//something
items : {
store : docListSearchStore,
},
renderTo: Ext.getBody()
}); var treeStore = Ext.create('Ext.data.TreeStore',{
root:{
expanded:true,
text:'Root',
children:[
{text:'p1',leaf:true},
{
text:'p2',
leaf:false,
expanded:false,
children:[
{text:'p2-1',leaf:true},
{
text:'p2-2',
leaf:true,
href:'treegrid.html',
hrefTarget:'_self'
}
]
}
]
}
});var tree = new Ext.tree.Panel({
id : 'tree',
width:270,
height:400,
title:ed.'Test2',
renderTo:Ext.getBody(),
autoScroll : true,
iconCls : 'tabHierarchy',
enableDD : false,
store:treeStore,
rootVisible:false,
useArrows:true,
columns: [{
text: 'haha',
width: 270,
dataIndex: 'DOC_UNIT_ID',
sortable: true
}]
}); var docTabPanel = new Ext.tab.Panel({
x : 0,
y : 0,
width:270,
height:400,
activeTab : 'tree',
id : 'docTabPanel',
items :[{
title: 'tree',
html: tree
}, {
title: 'searchPanel',
html: searchPanel
],
renderTo: Ext.getBody()
});
以上是我的部分代码,可是这段代码却一直运行不起来,不能够正常显示,不能够正常的加载到tabPanel里,不知道因为什么原因导致的,请高手帮我指点一下,先谢谢了extjsjavascriptautoload
root:{
expanded:true,
text:'Root',
children:[
{text:'p1',leaf:true},
{
text:'p2',
leaf:false,
expanded:false,
children:[
{text:'p2-1',leaf:true},
{
text:'p2-2',
leaf:true,
href:'treegrid.html',
hrefTarget:'_self'
}
]
}
]
}
});
var tree = new Ext.tree.Panel({
id : 'tree',
width:270,
height:400,
title:'Test2',
autoScroll : true,
iconCls : 'tabHierarchy',
enableDD : false,
store:treeStore,
rootVisible:false,
useArrows:true
});
var docTabPanel = new Ext.tab.Panel({
x : 0,
y : 0,
width:270,
height:400,
activeTab : 'tree',
id : 'docTabPanel',
items :[{
title: 'tree',
items : [ tree ]
}],
renderTo: Ext.getBody()
});