aleks_raiden
4 Jul 2010, 8:10 AM
Hi,
I trying to create own interface based on toolbars. Its docked by top, and if i click to other button, i try to add another button to toolbar. But i cant this, only removeAll and setTitle are working. If i try to use insert function (or another, e.g., add/addButton etc), in console: TypeError: Result of expression 'c' [undefined] is not an object. (at line 13711 in ext-debug). How i can dinamicly adding new button to toolbar?
new Ext.Panel({ fullscreen: true,
id: 'content',
scroll: 'vertical',
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
id: 'main_page_topbar',
title: 'Новости',
defaults: {
ui: 'mask'
},
scroll: 'horizontal',
items: [{
iconCls: 'refresh'
},{
text: 'XMLHTTP',
xtype: 'button'
}]
},
...
//and try to add button
var tBar = Ext.getCmp('main_page_topbar');
tBar.removeAll(true);
tBar.setTitle('Карта');
tBar.insert({iconCls: 'maps'}); // error at this line, if commented, all OK
tBar.doLayout();
I trying to create own interface based on toolbars. Its docked by top, and if i click to other button, i try to add another button to toolbar. But i cant this, only removeAll and setTitle are working. If i try to use insert function (or another, e.g., add/addButton etc), in console: TypeError: Result of expression 'c' [undefined] is not an object. (at line 13711 in ext-debug). How i can dinamicly adding new button to toolbar?
new Ext.Panel({ fullscreen: true,
id: 'content',
scroll: 'vertical',
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
id: 'main_page_topbar',
title: 'Новости',
defaults: {
ui: 'mask'
},
scroll: 'horizontal',
items: [{
iconCls: 'refresh'
},{
text: 'XMLHTTP',
xtype: 'button'
}]
},
...
//and try to add button
var tBar = Ext.getCmp('main_page_topbar');
tBar.removeAll(true);
tBar.setTitle('Карта');
tBar.insert({iconCls: 'maps'}); // error at this line, if commented, all OK
tBar.doLayout();