PDA

View Full Version : Solution: How to make the full toolbar clickable



pd1980
10 Jan 2012, 3:00 PM
Combining solution provided by andreacammarata (http://www.sencha.com/forum/member.php?77762-andreacammarata) here (http://www.sencha.com/forum/showthread.php?173162-Toolbar-full-length-clickable&p=712133&viewfull=1#post712133) with my own... here is how you can make a toolbar clickable.



Ext.setup({
onReady: function() {

var pnl = new Ext.Panel({
fullscreen: true,
items: [
{
xtype: 'toolbar',
title: 'Example',
listeners: {
afterrender: function() {
// add the custom attribute you need to access upon click. In my case, it was the link value
Ext.get(this.id).set({customAttributeName: customAttributeValue});
}
el: {
tap: function() {
// Access the custom attribute upon click
console.log( Ext.get(this.id).getAttribute('customAttributeName') );
},
delegate: 'div'
}
}
}
]
});




}
});

mitchellsimoens
11 Jan 2012, 7:24 AM
Are you asking a question or just posting a solution from another thread?