PDA

View Full Version : extend tbar



peturkirke
4 Nov 2014, 1:15 AM
I have a common view, which i want to extend.
Here is the code of the common view:




Ext.define("Common.view.account.List", {
extend: 'Ext.grid.Panel',
alias: 'widget.accountslist'


id: 'accounts',
title: _('Accounts'),
store: 'Accounts',
selModel: {
mode: 'MULTI'
},


initComponent: function() {
var me = this;


Ext.apply(me, {
columns: [{
header: _('Name'),
dataIndex: 'name',
flex: 2
}],
tbar: [{
text: _('Create'),
iconCls: 'icon-create',
action: 'create'
}, {
iconCls: 'icon-clear',
action: 'clear-search',
disabled: true
}]
});


me.callParent(arguments);
}
});






Then i want to extend it.
I want to add 2 more items to the tbar.
How can i do that in the code below ?








Ext.define("Specific.view.account.List", {
extend: 'Common.view.account.List',




--- what to write here to add 2 more items to tbar ? ---




});

slemmon
5 Nov 2014, 2:04 PM
You could do something like in the following example:

cu3