ExtJS抛出无效的domNode引用或现有domNode的id: null当试图将一个元素绑定到另一个元素的配置.&l



对于没有注释的绑定部分的代码,我得到了我在代码下面发布的错误消息。

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" charset="UTF-8" src="./ext-all-debug.js"></script>
<script type="text/javascript">
var resultsPanel = Ext.create('Ext.panel.Panel', {
title: 'Results',
width: 600,
height: 400,
border: true,
layout: {
type: 'vbox',       // Arrange child items vertically
align: 'stretch',    // Each takes up full width
padding: 5
},
items: [{               // Results grid specified as a config object with an xtype of 'grid'
xtype: 'button',
text: 'button1',
pressed: false,
reference: 'button1',
listeners : {
click: { fn: function(){ alert("heheh");}}
}
},
{
xtype: 'button',
text: 'button2',
bind: {
hidden: '{!button1.pressed}',
}
}
]
});
Ext.onReady(function () {
resultsPanel.render(Ext.getBody());
}, this, {delay: 1000});
</script>
</head>
<body>
</body>
</html>

下面的错误信息:

[E] Ext.dom.Element.constructor(): Invalid domNode reference or an id of an existing domNode: null ext-all-debug.js:10375:31
extPanel.html:34

当我从代码中删除bind部分时,一切都工作正常。

button1中必须添加:

enableToggle: true,

pressed仅用于切换按钮。

最新更新