Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Michele on Jan 30, 2008 04:47
open dhtmlx forum
dxtmlxcombo: problem when resizing page with combo inside a table

When I open the dropdownlist of the combo and start resizing the page, I got the combobox in the correct position but the dropdownlist still on the old position:

<script language="JavaScript" src="javascript/dhtmlXCommon.js" type="text/javascript"></script>

<script language="JavaScript" src="javascript/dhtmlxcombo.js" type="text/javascript"></script>
<script language="JavaScript" src="javascript/dhtmlxcombo_extra.js" type="text/javascript"></script>

.....


<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
<tr>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"><div id="combo_zone3" style="width:200px; height:30px;"></div></td>
<td width="25%"> </td>
</tr>
<tr>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
</table>


<script>

var z=new dhtmlXCombo("combo_zone3","alfa3",200);
z.addOption([[1,1111],[2,2222],[3,3333],[4,4444],[5,5555]]);
</script>

then just open the dropdown list and resize the page.
Answer posted by Support on Jan 31, 2008 05:37
Problem confirmed, to resolve it just add next line after combo initialization

var z=new dhtmlXCombo("combo_zone3","alfa3",200);
dhtmlxEvent(window,"resize",function(){
    z._positList();
});
Answer posted by Michele on Jan 31, 2008 06:09

 

It works quite fine on mozilla firefox, but I get the dropdown repositioned only when the user stop to resize. With IE6 instead I get a very strange behavior... I get a second dropdown list with a "false" in it...

Answer posted by Support on Jan 31, 2008 06:50
I really forgot about IE, code for both browsers will look as

dhtmlxEvent(window,"resize",function(){
    z._positList();
    if (_isIE) z._IEFix(true);

});