PDA

View Full Version : combobox insertAfter quirk



runnersixty
25 Nov 2007, 11:21 AM
I've existing html in which I want insert Ext.form.ComboBox.
I try to achieve this with insertAfter method, but only the textbox part of the component
is inserted, the image stay in another position.

This is example code to show this behaviour (/examples/panels/panels.js modified)

Ext.onReady(function(){
var p = new Ext.Panel({
title: 'My Panel',
collapsible:true,
renderTo: document.body,
width:400,
height:100,
html: '<span id=\"combo_pos\">test</span><span id=\"combo_render\"></span>'
});

var comboTest = new Ext.form.ComboBox(
{
renderTo: 'combo_render'
}) ;
comboTestEl = comboTest.getEl() ;
comboTestEl.insertAfter(Ext.get('combo_pos')) ;
});


BTW there is a better way to get this pattern (combos inserted into existing html) working ?

Thanks