PDA

View Full Version : How do I assign static Ids for the drop down list of Combox Box



anilcs0405
11 Dec 2008, 12:31 AM
I have a requirement for testing automation which says there should be DOM IDs for the drop down menulist items of the Combo Box.

I tried using 'render' event to capture its DOM node. Here is the code. But I saw that the drop down menu list is not in this DOM node.

var combo = new Ext.form.ComboBox({
store: store,
displayField:'state',
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
emptyText:'Select a state...',
selectOnFocus:true,
applyTo: 'local-states',
listeners: {
render: function(el){
var p = el.getEl().dom;
alert('p:'+p);
}

}
});


But this shows an alert p: [object HtmlInputElement] , so obviously it cant have the menulist contained in it.

I tried using 'expand' event also. But is not working.

So how do I do that?

Thanks in Advance!

Animal
11 Dec 2008, 1:05 AM
The element of any input field is an <input type="text"> so it's not going to contain any further DOM elements.

The elements are in the DataView.

I see you are using mode:'local', so the Store is already filled?

Try configuring your combo with



lazyInit: false,
onRender: Ext.form.ComboBox.prototype.onRender.createSequence(function() {
// I think your should be able to process this.view here.
// By this time, the DataView should contain the dropdown list.
})