PDA

View Full Version : How can a dateMenu in menu disappear?



hlzhang1982
23 Nov 2009, 1:42 AM
Hi, all:
Now I met an issue: there is a formpanel(fpA) in an menu(menuB, Ext.menu.Menu) and a datefield in the formpanel fpA. Now, when click datefield, menuB will be disappeared. We can added following code to fixed above issue:


menu: new Ext.menu.DateMenu({
hideOnClick: false,
allowOtherMenus: true}),


Now there is an other issue: when click other space in fpA, the dateMenu which poped up of datefield can not be disappeared(the dateMenu can disappear ONLY when select a date).
Any suggestion? Thanks in advance.

[
You can test using following code:


<div id="BTN"></div>

Ext.onReady(function () {
new Ext.Button({
id: 'BTN1',
renderTo: 'BTN',

text: '',
menu: {
items: new Ext.FormPanel({
id: 'p',
labelWidth: 60,
layout: 'form',
defaultType: 'datefield',
bodyStyle: 'padding:5px 5px 0',
width: 250,
height: 200,
border: false,
items: [{
xtype: 'datefield',
fieldLabel: 'Date debut',
format: 'd-m-Y',
value: '01/01/2010',
menu: new Ext.menu.DateMenu({
hideOnClick: false,
allowOtherMenus: true // <- otherwise other menu is hidden
})
}]
})
//}]
}
}).show();
});

]

hlzhang1982
23 Nov 2009, 5:21 PM
Any suggestions?