arnigudj
13 Jul 2007, 4:00 AM
I'm using a submenu in a toolbar that uses the Datepicker. When someone picks a date I want the date handler to access the text from the submenu. I'm new to Extjs and I've tried item.text and so on, but haven't been able to get it right.
Here is an example code:
var sort = new Ext.menu.DateMenu({
handler : function(dp, date){
//How can I access the text here? (see below)
}
});
var menu = new Ext.menu.Menu({
id: 'mainMenu',
items: [ {
text: 'pick a date',
cls: 'calendar',
menu: sort// <-- submenu by reference
}]});
var gridHeaderPanel = grid.getView().getHeaderPanel(true);
var tb = new Ext.Toolbar(
gridHeaderPanel,
[{
cls: 'x-btn-text-icon bmenu', // icon and text class
text: 'THE TEXT I WANT TO GET',
menu: sort // assign menu by instance
}]});
any ideas?
ps. The Extjs is awesome!
Here is an example code:
var sort = new Ext.menu.DateMenu({
handler : function(dp, date){
//How can I access the text here? (see below)
}
});
var menu = new Ext.menu.Menu({
id: 'mainMenu',
items: [ {
text: 'pick a date',
cls: 'calendar',
menu: sort// <-- submenu by reference
}]});
var gridHeaderPanel = grid.getView().getHeaderPanel(true);
var tb = new Ext.Toolbar(
gridHeaderPanel,
[{
cls: 'x-btn-text-icon bmenu', // icon and text class
text: 'THE TEXT I WANT TO GET',
menu: sort // assign menu by instance
}]});
any ideas?
ps. The Extjs is awesome!