PDA

View Full Version : Toolbar full length clickable



pd1980
9 Jan 2012, 1:20 PM
I think this question/request has been asked for multiple times everywhere, but I am not able to find a single solution.

I want the complete length of the toolbar to be clickable. This is a stand alone toolbar, not part of the list grouped title or anything. ( And I need exactly that. Cannot change my solution to have a list, because under each title, I have different display templates for different type of content. ) Is there a way to bind a tap/itemtap event to the toolbar body?

Thanks,
PD

AndreaCammarata
10 Jan 2012, 2:29 AM
Hi PD,
this is a way to achieve that, simply using event delegation on the toolbar element:



Ext.setup({
onReady: function() {

var toolbarTap = function(){
alert('TAP');
};


var pnl = new Ext.Panel({
fullscreen: true,
dockedItems: [
{
xtype: 'toolbar',
title: 'Example',
listeners: {
el: {
tap: toolbarTap,
delegate: 'div'
}
}
}
]
});


}
});


Hope this helps.

pd1980
10 Jan 2012, 2:49 PM
That was very helpful. =D>