Apr 14, 2013, 9:25 PM
[CLOSED] [#206] Setting custom icon on treenode removed loading icon
If you set a custom icon to async treenode, the loading icon is gone when you expand that node. In the example below, expand Root and notice you get a gray loading icon. Expand one of the new child node and no loading icon. The loading icon is helpful to let user know that something is happening so they don't try to expand the node again while it is loading from the server.
<script runat="server">
Protected Sub NodeLoad(sender As Object, e As NodeLoadEventArgs)
Dim nodeId = e.NodeID
Dim nodes As NodeCollection = New Ext.Net.NodeCollection()
System.Threading.Thread.Sleep(1000)
If Not String.IsNullOrEmpty(nodeId) Then
For i As Integer = 1 To 5
Dim asyncNode As New Node()
asyncNode.Text = nodeId + i
asyncNode.NodeID = nodeId + i
asyncNode.Icon = Ext.Net.Icon.FolderBell
nodes.Add(asyncNode)
Next
End If
e.Nodes.AddRange(nodes)
End Sub
</script>
<html>
<head id="Head1" runat="server">
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Gray" />
<ext:TreePanel ID="TreePanel1" runat="server" Title="Tree" Width="200" Height="500"
Border="false" UseArrows="true">
<Store>
<ext:TreeStore ID="TreeStore1" runat="server" OnReadData="NodeLoad">
<Proxy>
<ext:PageProxy />
</Proxy>
</ext:TreeStore>
</Store>
<Root>
<ext:Node NodeID="0" Text="Root" />
</Root>
</ext:TreePanel>
</form>
</body>
</html>
Last edited by Daniil; Mar 05, 2014 at 9:43 AM.
Reason: [CLOSED]