PDA

View Full Version : ExtJS menu button close issue



Pravin.Pawar
25 Sep 2012, 1:13 AM
Hi,

im using following code to populate ExtJS menu somehow OKbutton do NOT close menu when i click on the button.

items: [{
id: 'yearid',
text: 'Year: ' + year,
menu: {
items: [{
xtype: 'container',
layout: 'hbox',
items: [{
id: 'txtYear',
xtype: 'textfield',
width: 50,
margin: '0 0 0 5'
}, {
xtype: 'button',
text: 'OK',
width: 55,
margin: '0 0 0 5',
handler: '_YEARHANDLER_'
}]
}]
}
}

Please let me know if you have any idea.

sword-it
25 Sep 2012, 6:23 AM
Hi Pravin,

Try this code -


handler: function(){
this.up('menu').close()
}


See working example here http://jsfiddle.net/fGG2W/