I have a combo box in a dialog, if I have the box's list expanded and move the dialog the result box doesn't move with the dialog.

#2
![]() |
![]() Also is there a way to clear the value field? Each time I open my dialog with the combo box I'd like to clear the previous result, since I'm only creating the combo once.
I've tried: Ext.get('mycombo').value = ""; and combo.setValue() I'm sure it's something easy I'm just missing. This control is great!! Thanks for the help. ![]() |
#3
![]() |
![]() I haven't tried it, but maybe it shoud be something like:
Ext.get('mycombo').set({value: ""}); ![]() |
#4
![]() |
![]() That doesn't seem to be it, also in a dialog there never seems to be a cursor in the combo and I can't seem to set it's focus....
![]() |
#5
![]() |
![]() Ext.get gets an Element.
You need a reference to the input object: setValue() on a combobox uses the parameter as a key - it finds the record where the designated value field matches. To simply clear the input field: myCombobox.el.dom.value = ""; ![]() |
#6
![]() | |
![]() Quote:
dialog.on('move', function(dlg, x, y) { comboBox.list.alignTo(comboBox.el, comboBox.listAlign); }); ![]() |
#7
![]() |
![]() I've tried to search but found nothing. How can I find a widget associated to an input element without passong a reference? Is that possible? I know that Ext.get() returns an Element, is there an equivalent function for widgets?
I'm using the word widget for differentiating it from Element, I mean something like TextField or DateField. Thank you. ![]() |
#8
![]() |
![]() If you are using a valueField constraint, they setValue('') will not work as it won't be found. You can call combo.el.setValue('') though if the field has been rendered.
If you aren't aren't using a valueField constraint, they setValue('') is the way to do it. mdelanno, that is exactly what is needed. The sad thing is there is no way (currently) for the combo to know the mousedown occured since drag drop kills bubble of the mousedown. Since drag drop is part of Ext now, I will of course be correcting that. fponticelli, if you include an id in your component config and the widget you are using extends component (like combobox) you can get a reference from the component manager from anywhere. Eventually I hope to move all widgets over to the component interface. var combo = Ext.ComponentMgr.get('combo-id'); ![]() |
#9
![]() |
![]() That's it, thank you very much.
![]() |