PDA

View Full Version : help with toolbar



Unkind
14 Oct 2012, 11:07 PM
I have some toolbar

this.tbar = {
xtype: 'toolbar',
items: [

{
id: "btnClearFilter",
itemId: "btnClearFilter",
action: 'delFilter',
disabled: true,
handler: function (btn, e) {
btn.setDisabled(true);
}
},
'-',
{
text: 'Export',
tooltip: 'Export',
disabled: false,
menu : {
items: [{
text: 'Export 1'
, icon: 'Content/Resources/images/Excel-16.png'
, action: 'export'
}]
}
}
]
};

From controller i can cause action delFilter like this


'ns-main-win > toolbar button[action=delFilter]': {
click: this.delFilter
},

How couse action "export" from menu item?

Unkind
15 Oct 2012, 12:25 AM
I want something like this



'ns-main-win > toolbar > menu > menuitem button[action=export]': { click: this.export},

vietits
15 Oct 2012, 12:40 AM
Try this:


'ns-main-win > toolbar menu menuitem[action=export]': {
click: function(){
console.log('export menu clicked');
}
},

Unkind
15 Oct 2012, 12:53 AM
Try this:


'ns-main-win > toolbar menu menuitem[action=export]': {
click: function(){
console.log('export menu clicked');
}
},


thanks, this work :)