Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Theo Kien on Jan 12, 2010 04:02
open dhtmlx forum
dhtmlXTree horizontal resize problem with FireFox 3.5

I've got a dhtmlXTree with horizontal size 100%. When resizing the browser windown horizontally, in IE8 the tree resizes correctly within its DIV.

When using FireFox 3.5, when enlarging the window, the tree only resizes so the width of the largest text in the tree and not further.
When reducing the window size, the tree reduces the width only a little bit until the largest text hits the right border of the tree (behind the vertical scroll bar). After that, the tree does not reduce any more and the width extends the width of the container div.

What can I do in FF to change this?

Theo
Answer posted by Alex (support) on Jan 12, 2010 07:38

The issue wasn't reproduced locally. Please provide the sample where we can reproduce the issue.

Answer posted by Alex (support) on Jan 12, 2010 07:41
Also please try to test the page with all FireFox plugins disabled.
Answer posted by Theo on Jan 12, 2010 08:04

I've disabled all the pluging, by renaming the following files

C:\Documents and Settings\cesptki\Application Data\Mozilla\Firefox\Profiles\ymxuoqzl.default\extensions\{E2883E8F-472F-4fb0-9522-AC9BF37916A7}\plugins\np_gp.dll
C:\Program Files\Mozilla Firefox\plugins\npnul32.dll
C:\WINDOWS\system32\Macromed\Flash\NPSWF32.dll
c:\Program Files\Microsoft Silverlight\3.0.40723.0\npctrl.dll
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Windows Presentation Foundation\NPWPF.dll
C:\Program Files\Java\jre6\bin\npjpi160_17.dll
C:\Program Files\Java\jre6\bin\npdeploytk.dll
C:\Program Files\Java\jre6\bin\npoji610.dll
C:\Program Files\Adobe\Reader 9.0\Reader\browser\nppdf32.dll
C:\Program Files\QuickTime\Plugins\npqtplugin7.dll
C:\Program Files\QuickTime\Plugins\npqtplugin6.dll
C:\Program Files\QuickTime\Plugins\npqtplugin5.dll
C:\Program Files\QuickTime\Plugins\npqtplugin4.dll
C:\Program Files\QuickTime\Plugins\npqtplugin3.dll
C:\Program Files\QuickTime\Plugins\npqtplugin2.dll
C:\Program Files\QuickTime\Plugins\npqtplugin.dll
C:\Program Files\Windows Media Player\npdrmv2.dll
C:\Program Files\Windows Media Player\npdsplay.dll
C:\Program Files\Windows Media Player\npwmsdrm.dll

Unfortunately, the tree still behaves the same way.

I've attached the jsp and js files that are creating the divs and tree (ctreeBox).

Theo

Attachments (2)
Answer posted by Alex (support) on Jan 12, 2010 09:21

In your sample the tree is initialized in the ctreeBox container. Please check that ctreeBox has desired width when the window is resized.

The second parameter of the dhtmlXTreeObject method defines which part of the parent container the tree will occupy. The following code means that tree width will be the same as the width ctreeBox container. But it doesn't sets the size of the ctreeBox div. 

var ctree = new dhtmlXTreeObject(document.getElementById('ctreeBox'), '100%', '300', 0);

 Style of the ctreeBox (including height and width) should be set by css.

Answer posted by Theo on Jan 12, 2010 23:28

Thanks Alex,

now the country tree expands according to the expansion of the container (see picture larger.jpg).

If, however, the container is made smaller in width, the tree only reduces its width as long as the nodes' text fits in the container. If the container is smaller than the text, the tree extends outside the container (see picture smaller.jpg). This only happens in FireFox, not in IE.

Theo

ps the colors in the screen or only used to make the different DIVs more visible during development...

Attachments (2)
larger.jpg163.33 Kb
smaller.jpg150.01 Kb
Answer posted by Alex (support) on Jan 13, 2010 01:59

Hello

we have checked the images. The issue doesn't  relate to tree functionality. Please check the styles of the elements on your page.  

Answer posted by Theo on Jan 13, 2010 02:22

I've checked all the DIV's but I can't find an explanation why the tree box doesn't let itself reduce in width in FireFox.

If I give the tree 100% height so that no vertical scroll bar is visible, you can clearly see the tree box only reduces in width so that the largest text is still visible and then stops (see attached picture 11). It doesn't produce a horizontal scrollbar. It can't be coincidence that the width of the box adapts to the text of the tree nodes.

Why does the ctreeBox and the container expand correctly if the window is enlarged but not the when being made smaller? Why does it work correctly in IE and not in FF? I haven't defined any min-width....

This is how the creation is done now:

ctree = new dhtmlXTreeObject(document.getElementById('ctreeBox'), '100%', '100%', 0);

The definition of the containing div:

<div id="ctreeBox" style="float:left;background:white;width:100%;height:100%">
<div id="cloading">
&nbsp;&nbsp;Loading...
<img src='<%= request.getContextPath() %>/images/loading.gif' />&nbsp;&nbsp;
</div>
</div> <!-- ctreeBox -->

Attachments (1)
Answer posted by Alex (support) on Jan 13, 2010 02:33

Instead of tree initialization you can place the container with table inside if for testing - the behavior will be the same and it depends on the style of your page:

<div id="ctreeBox" style="float:left;background:white;width:100%;height:100%">

   <div style="width: 100%; height: 100%;"> 

       <table width="100%" style="margin: 0pt; padding: 0pt; overflow: hidden;">

          ...

       </table>

   </div>

</div>

Answer posted on Jan 13, 2010 02:38
I am not sure I've understood correctly. What do you expect to be inside the table? The content of the tree?
Answer posted by Alex (support) on Jan 13, 2010 06:32

>> I am not sure I've understood correctly. What do you expect to be inside the table? 

any rows can be inside table. 

Tree initialization code creates a container with 100% width and 100% height and table inside, this structure can not be changed. If instead of tree, you will place the html from the previous answer - probably the result will be the same. It is just for the test if you're sure that some tree functionality causes the problem.

Answer posted by Theo on Jan 17, 2010 23:38

Thanks for your help. You are right, with the table instead of the tree the behaviour is the same, so the problem is not caused by the tree.
I'll need to find out what is wrong in the CSS so that FireFox doesn't work as expected.

Again, thanks for your help.
Theo