当我点击同一个按钮超过 1 次时,我收到此错误。这表明什么,我应该采取什么措施来防止它;
[WARN] [WARN][Ext.Component#constructor] Registering a component with a id (`form1`) which has already been used. Please ensure the existing component has been destroyed (`Ext.Component#destroy()`.
2012-05-08 21:29:56.869 ProjectSeal[870:fb03] [WARN] [WARN][Ext.Component#constructor] Registering a component with a id (`new-note-btn1`) which has already been used. Please ensure the existing component has been destroyed (`Ext.Component#destroy()`.
根据错误/警告,我如何销毁
组件?
更新
Ext.define('app.view.Contact',{
extend:'Ext.form.Panel',
xtype:'contactform',
id: 'form1',
....
如何让 Sencha 将 id 添加到我的代码中?
更新
[WARN] [DEPRECATE][Anonymous] itemId is deprecated as a property directly on the Component. Please put it inside the config object, and retrieve it using "this.config.itemId"
最佳答案
当用户单击按钮时,您很可能会创建一个窗口或表单对象。在创建过程中,您似乎正在将硬编码的 id
分配给该组件。
您需要确保先前使用的表单已被销毁(例如,检查 closeAction
属性),或者不要自己分配 id
属性并让 Sencha 执行此操作。
关于cordova - 收到错误消息 "Registering a component with a id (` form 1`) which has already been used",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10502190/