對于未注釋系結部分的此代碼,我收到了我在代碼下方發布的錯誤訊息。
<!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
當我從代碼中洗掉系結部分時,一切正常。
uj5u.com熱心網友回復:
在button1您必須添加:
enableToggle: true,
pressed僅適用于切換按鈕。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/489564.html
標籤:javascript dom extjs
