-
Unanswered: Extend a form.panel component?
Unanswered: Extend a form.panel component?
I found a strange thing about a custom component that extending a form panel, a dummy component would be as the following
Ext.define('Dummy', {
extend: 'Ext.form.Panel',
border: false,
items: [],
defaults: {
border: 0
},
initComponent: function () {
var me = this;
me.items.push({ html: 'to', style: "width:20px;padding:5px" });
me.callParent();
}
}
Now try to create the dummy component in another panel twice, as the following
var item1 = Ext.create('Dummy', {
});
var item2 = Ext.create('Dummy', {
});
this.items = [item1, item2];
Instead of 2 form panels with their respective items, the second panel somehow grabs the items from the first form panel and add them to itself.
Why?
What is the proper way to extend from panel?
-
Found my mistake.
Should not be
me.items.push(...).
rather, should be simply
me.items = [];
thanks anyway
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us