PDA

View Full Version : Don't close menu on checked



Asken
6 Jun 2010, 10:45 PM
I have a menu in a toolbar. When checking a menu item the menu closes. Can I prevent that behaviour as it should be possible to check several before closing the menu?

K

Condor
6 Jun 2010, 10:56 PM
hideOnClick:false

Asken
6 Jun 2010, 11:31 PM
All too easy! Should have found that!

Thanks!

foe
2 Jul 2010, 8:24 AM
Condor does this approach works on a formpanel contained inside a menu?

I'll paste a snippet of how my menu looks like...




menu: {
xtype: 'menu',
style: {
overflow: 'visible' // For the Combo popup
},
defaults: {

},
items:[
{
xtype: 'form',
labelAlign: 'top',
items:[
{
xtype: 'textfield',
allowBlank: false,
fieldLabel: 'Name',
id: 'name',
anchor: '100%'
},
{
xtype: 'combo',
id: 'fieldType',
fieldLabel: 'Field Type',
allowBlank: false,
selectOnFocus: true,
editable: false,
triggerAction: 'all',
store: availableDataTypesStore,
displayField:'name',
valueField: 'code',
mode: 'local',
emptyText:'Select..',
anchor: '100%'
}
]
}
]
}


I've tried including hideOnClick: false on the combo or the form and none of those did the trick...

Thanks in advance...

Animal
2 Jul 2010, 9:36 AM
In the form.

Works for me:

http://i131.photobucket.com/albums/p286/TimeTrialAnimal/form-in-menu.jpg

Animal
2 Jul 2010, 9:40 AM
Your combo will need




getListParent: function() {
return this.el.up('div.x-menu');
},

foe
2 Jul 2010, 9:49 AM
Thanks Animal, works like a charm...

Now I'm curious, how did you manage to make your form looks like embedded on the menu... Mine looks white and I'm kinda having trouble with the buttons positioning. If I use the buttons property of the form the panel just looses its proportion.

Any help on this topic would be great...

Thanks :)

Animal
2 Jul 2010, 10:39 AM
Configure your menu



plain: true


And the FormPanel




border: false,
bodyStyle: {
background: 'transparent'
},
padding: 5,

foe
15 Jul 2010, 11:06 AM
Your combo will need




getListParent: function() {
return this.el.up('div.x-menu');
},


And what about when using a DateField? I tried looking for something similar to the getListParent but I couldn't find something similar...

Do you know how to work around this?

~ Thanks in advance!!!!!

Animal
15 Jul 2010, 11:10 AM
you'll have to look at the source

foe
15 Jul 2010, 11:10 AM
I just looked at the forum and found the solution thanks to condor...

It goues like this....

new Ext.menu.DateMenu({
hideOnClick: false,
allowOtherMenus: true // <- otherwise other menu is hidden
});

Full thread is there....

http://www.sencha.com/forum/showthread.php?83734-datefield-the-calendar-does-not-appear-.-.-.

foe
15 Jul 2010, 11:14 AM
Thanks for the quick response....

I already found a solution that works pretty well here on the forums....

It goes like this...


menu: new Ext.menu.DateMenu({
hideOnClick: false,
allowOtherMenus: true // <- otherwise other menu is hidden
});

The link to the thread is... http://www.sencha.com/forum/showthread.php?83734-datefield-the-calendar-does-not-appear-.-.-

foe
15 Jul 2010, 12:54 PM
I found a solution posted on the forums.....

link is here...

http://www.sencha.com/forum/showthread.php?83734-datefield-the-calendar-does-not-appear-.-.-.