Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Michele on Feb 04, 2008 03:26
open dhtmlx forum
dhtmlxcombo inside a table and inside a div: very strange behavior with IE and Safari

I have, inside the body tag, a situation like the following...

<table border="0" cellpadding="0" cellspacing="0" style="left: 0px; top: 0px; width:100%; height:100%;" >
<tr>
<td width="350px" >
</td>
<td style="width: 100%; ">
</td>
<td width="355px" >

<div style="height:24px; width:355px; position: relative; top:4px; ">
                            <div id="combolanguage" style="width:125px; height:30px;"></div>
</div>
</td>
</tr>
</table>
</div>

<script>
window.dhx_globalImgPath="treeimgs/";

var z=new dhtmlXCombo("combolanguage","alfa3",200, 'image');
        z.loadXMLString('<?xml version="1.0" ?> <complete> <option value="1" img_src="img/world5.gif">one</option> <option value="2" img_src="img/world5.gif">two</option> <option value="3" img_src="img/world5.gif">three</option> </complete>');
        


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


</script>

With Firefox it seems to work fine, while with IE I get a very strange behavior when I resize and when I open the comboboxlist. With Safari the position seems ok but when I open the listbox I don't see any option...
Answer posted by Support on Feb 04, 2008 06:57
Problem caused by
    <div style="height:24px; width:355px; position: relative; top:4px; ">

In case of IE, container with relative positioning break normal offset calculation, and javascript routine just can't calculate position properly.
The only possible solution - add some hardcoded fix for IE , especially for layour in question ( dhtmlxcombo.js _positList method )