PDA

View Full Version : [CLOSED] TreePanel empty folder issue



rmelancon
Aug 01, 2014, 5:50 PM
I have a tree panel on a page that errors as soon as the page is loaded. I stripped the code down for an example and now the error occurs only when expanding the empty folder, but it is the same error so hoping that solving this error will fix the problem in the "real" code. To reproduce just expand the empty folder.


<%@ Page Language="vb" %>
<script runat="server">

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

End Sub

</script>

<style type="text/css">
.tree {
float : left;
margin : 20px;
border : 1px solid #c3daf9;
}
</style>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>DragDrop</title>
<script type="text/javascript">

</script>
</head>
<body>

<ext2:ResourceManager ID="ResourceManager" runat="server" />

<div class="tree">
<ext2:TreePanel ID="tpClient"
runat="server"
Title="Client"
Width="375"
Height="650"
cls="tree"
Border="false"
Collapsible="false"
UseArrows="true"
RootVisible="True"
MultiSelect="false"
SingleExpand="true"
FolderSort="true">
<Fields>
<ext2:ModelField Name="ID"></ext2:ModelField>
<ext2:ModelField Name="DisplayName"></ext2:ModelField>
<ext2:ModelField Name="AccountNumber"></ext2:ModelField>
</Fields>
<ColumnModel>
<Columns>
<ext2:TreeColumn Flex="2" runat="server" Dataindex="DisplayName" Text="Name" />
<ext2:Column Flex="1" runat="server" Dataindex="AccountNumber" Text="Account Number" />
</Columns>
</ColumnModel>

<Root>
<ext2:Node NodeID="RootClient" Text="Client" Icon="Folder" Expanded="false">

</ext2:Node>
</Root>
</ext2:TreePanel>
</div>

</body>
</html>

Vladimir
Aug 01, 2014, 6:04 PM
If node is not leaf and have no children then tree will initiate request to read children
So, please define proxy for tree store
http://examples2.ext.net/#/TreePanel/Loaders/Page/

or set Leaf="true" for non folder node or set EmptyChildren="true" to point that it is folder node but without children

rmelancon
Aug 01, 2014, 6:17 PM
Got it. EmptyChildren needs to be true as there are no children when the form first loads.
Thanks.