extjs xml树示例,我将其放入extjs提供的布局浏览器示例中
下面是我用来加载到布局浏览器中的javascript变量…您会注意到listener部分被注释掉了…当我取消对该部分的注释时,布局浏览器和树不会显示。当我注释掉listener部分时,布局浏览器和树工作正常,只有listener填充了pool details面板 你知道为什么监听器会破坏布局浏览器和树的渲染吗extjs xml树示例,我将其放入extjs提供的布局浏览器示例中,extjs,Extjs,下面是我用来加载到布局浏览器中的javascript变量…您会注意到listener部分被注释掉了…当我取消对该部分的注释时,布局浏览器和树不会显示。当我注释掉listener部分时,布局浏览器和树工作正常,只有listener填充了pool details面板 你知道为什么监听器会破坏布局浏览器和树的渲染吗 var PoolStackTree = { id: 'PoolStackTree-panel', title: 'Pool List', layout: 'border',
var PoolStackTree = {
id: 'PoolStackTree-panel',
title: 'Pool List',
layout: 'border',
width: 500,
height: 500,
items: [{
xtype: 'treepanel',
id: 'pooltree-panel',
region: 'center',
margins: '2 2 0 2',
singleExpand: true,
animate: true,
useArrows: true,
autoScroll: true,
rootVisible: false,
root: new Ext.tree.AsyncTreeNode(),
loader: new Ext.app.PoolLoader({ dataUrl: 'calmonpool_views_xml.cgi' })
/*
listeners { 'render': function(tp) {
tp.getSelectionModel().on('selectionchange', function(tree-pool, node-pool) {
var el = Ext.getCmp('pool-details-panel').body;
if(node-pool && node-pool.leaf) {
tpl.overwrite(el, node-pool.attributes);
} else {
el.update(detailsText);
}
})
}}
*/
},{
id: 'pool-details-panel',
title: 'Pool Details',
region: 'south',
autoScroll: true,
collapsible: true,
split: true,
margins: '0 2 2 2',
cmargins: '2 2 2 2',
height: 220,
html: detailsText
}]
};
侦听器属性名称前缺少逗号,属性名称后缺少冒号:
...,
listeners: { ...
首先,你错过了a:听众之后。这肯定会导致树无法渲染 好的..我在侦听器中添加了冒号并添加了逗号..仍然没有gotpl:var tpl=new Ext.Template'{title}','Pool:{published}','事务:{innerText}';同样的问题弗兰克:听众也不为我工作。。。你从ExtJS2升级到ExtJS3了吗?我就是这么做的!