In Ext JS 4.1.1, how do I programmatically add items to a buttongroup
-
30-06-2021 - |
Domanda
In Ext JS 4.1.1, how do I programmatically add items to a buttongroup? If I add items as part of defining a buttongroup, it works, for eg:
Ext.define('company.ButtonGroup', {
extend: 'Ext.container.ButtonGroup',
title: 'File',
columns: 2,
defaults: {
scale: 'small'
},
items: [
{ text: 'New', iconCls: 'new16' },
{ text: 'Open', iconCls: 'open16' }
]
});
var fileButtongroup = Ext.create('company.ButtonGroup');
However, if I try to assign an array of items, it doesn't work. For eg:
var fileArr = [
{ text: 'New', iconCls: 'new16' },
{ text: 'Open', iconCls: 'open16' }
];
Ext.define('company.ButtonGroup', {
extend: 'Ext.container.ButtonGroup',
title: 'File',
columns: 2,
defaults: {
scale: 'small'
}
});
var fileButtongroup = Ext.create('company.ButtonGroup');
fileButtongroup.items = fileArr;
Further, I don't see any setItems()
method also.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow