Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4032
How to Webtree resize to clientHight
posted

Hello.

I like to set fixed size (width=300px, height=100%) of the webtree not expanding over the settings when adding nodes or long nodes labels (labels should be clipped). I have placed the webtree in html table cell (style = width=300px; height=100%).

But it does not work. There is also now CSOM function to resize the tree like the webgrid.

Thanks for any help. Markus

Parents
  • 28464
    Verified Answer
    posted

    Using the CSOM you can get to the root HTML Element of the UltraWebTree instance (<div>) and you can resize it directly using .style.height. For example: 

        <ignav:UltraWebTree ID="UltraWebTree1" runat="server" DefaultImage=""
            HiliteClass="" HoverClass="" Indentation="20" Height="60px">
            <Levels>
                <ignav:Level Index="0" />
            </Levels>
            <Nodes>
                <ignav:Node Text="Root Node">
                    <Nodes>
                        <ignav:Node Text="Child Node">
                        </ignav:Node>
                        <ignav:Node Text="Child Node">
                        </ignav:Node>
                        <ignav:Node Text="Child Node">
                        </ignav:Node>
                    </Nodes>
                </ignav:Node>
                <ignav:Node Text="Root Node">
                    <Nodes>
                        <ignav:Node Text="Child Node">
                        </ignav:Node>
                        <ignav:Node Text="Child Node">
                        </ignav:Node>
                        <ignav:Node Text="Child Node">
                        </ignav:Node>
                    </Nodes>
                </ignav:Node>
            </Nodes>
        </ignav:UltraWebTree>
     
     
        <br /><br />
        
        <asp:Button ID="Button1" runat="server" onclientclick="return resizeTreeView()" />
        
        <script type="text/javascript">
        
        function resizeTreeView()
        {
            var tree = igtree_getTreeById("<%= UltraWebTree1.ClientID %>");
            
            tree.Element.style.height = "500px";
            
            return false;       
        }
        
        </script>

    Hope this helps. 

Reply Children