ferr
16 Nov 2007, 9:37 AM
I recently needed to add a couple of dynamic image links after a list of dynamically generated combo boxes. The idea was that I would use insertHtml to add the html directly.
Originally I tested this out on a combo box that was generated dynamically inside of a column of a form, so I was retrieving it with findField and inserting html that way with code like this:
formEditDocuments.findField("edit-doctype").getEl().insertHtml("afterEnd",
'<a href="javascript:HandleBtnReset()"><img src="Images/collapse.jpg"></a>',
false);
...
new Ext.form.ComboBox({
fieldLabel: 'Document Type',
store: dsDocTypes,
displayField: 'doctype',
editable: false,
mode: 'remote',
name: 'edit-doctype',
triggerAction: 'all',
emptyText:'Select...',
selectOnFocus:true,
width: 425
}),
The problem was that the html was being inserted after the combo box's text field object rather than after the combo box's button.. so the button was being pushed out by the new html.
Either I'm doing something I shouldn't be doing or this is a bug. It may just be that getEl() isn't returning what I fully need in the instance of using it on a returned field from findField.
More Details:
Using Ext 1.1.1
Windows XP
Firefox 2 (tested)
http://img124.imageshack.us/img124/2213/bug1qc0.png
Originally I tested this out on a combo box that was generated dynamically inside of a column of a form, so I was retrieving it with findField and inserting html that way with code like this:
formEditDocuments.findField("edit-doctype").getEl().insertHtml("afterEnd",
'<a href="javascript:HandleBtnReset()"><img src="Images/collapse.jpg"></a>',
false);
...
new Ext.form.ComboBox({
fieldLabel: 'Document Type',
store: dsDocTypes,
displayField: 'doctype',
editable: false,
mode: 'remote',
name: 'edit-doctype',
triggerAction: 'all',
emptyText:'Select...',
selectOnFocus:true,
width: 425
}),
The problem was that the html was being inserted after the combo box's text field object rather than after the combo box's button.. so the button was being pushed out by the new html.
Either I'm doing something I shouldn't be doing or this is a bug. It may just be that getEl() isn't returning what I fully need in the instance of using it on a returned field from findField.
More Details:
Using Ext 1.1.1
Windows XP
Firefox 2 (tested)
http://img124.imageshack.us/img124/2213/bug1qc0.png