PDA

View Full Version : Form ComboBox question



mgoncharov
22 Feb 2010, 1:16 PM
I have the 2 column form and one of the fields is standard extJS ComboBox.

I need to add the icon with the link to the right of the comboBox.

What is the bext way to do it ?
1) Extend the ComboBox class and add the image with the link ?
2) Use the getCmp method and get use the DomHelper to append image after the form was loaded ?

This is what I have so far :

Ext.namespace('Ext.ux.form');
Ext.ux.form.LookupComboBox=Ext.extend(Ext.form.ComboBox, {
onRender: function(ct, position) {

Ext.ux.form.LookupComboBox.superclass.onRender.call(this, ct, position);

var wrap = this.el.up('div.x-form-field-wrap');
this.wrap.applyStyles({position:'relative'});
this.lstdiv = Ext.DomHelper.append(wrap,{});

lst='<a href="javascript:lookup()"><img src=../images/list.png></a>';

Ext.DomHelper.insertAfter(this.el, lst);

}

});

Ext.reg('lookupcombo', Ext.ux.form.LookupComboBox);

Please advice

Thanks

Mikhail