View Full Version : [CLOSED] HOW TO make a client-side refresh of a TreeNode in a TreePanel - EXT.NET 2.4.x

Jan 29, 2014, 1:09 PM
I'm using EXT.NET and i'm trying to refresh a node in a tree panel, after a value to compile a field of a column belonging to the panel is inserted from a prompt panel.
The treepanel is in an empty .ascx file and it's dynamically built using a web service.

<ext:Panel runat="server" ID="parametriIN" Width="650" Height="450">
<ext:TreePanel ID="treeOBJ" runat="server" Title="Parametri in ingresso"
Icon="BookOpen" RootVisible="false"
Width="650" Height="300" AutoScroll="true">
<ext:ModelField Name="text" />
<ext:ModelField Name="Type" />
<ext:ModelField Name="Value" />
<ext:TreeColumn ID="TreeColumn1" runat="server" Header="Parameter name" Flex="1" DataIndex="text"/>
<ext:Column ID="ColonnaTipo" runat="server" Header="Type" Width="150" DataIndex="Type"/>
<ext:Column ID="ColonnaValore" runat="server" Header="Value" Width="250" DataIndex="Value" ToolTip=""></ext:Column>
<ext:CommandColumn ID="CommandColumn1" Header="" runat="server" Width="40">
<ext:GridCommand CommandName="Edit" Icon="PageWhiteEdit" ToolTip-Title="Set value" ToolTip-Text="Set value" />
<PrepareToolbar Handler="return record.data.leaf;" />
<Command Handler="valorize(record);" />
<ext:StatusBar ID="StatusBar1" runat="server" AutoClear="1500" />
Handler="#{StatusBar1}.setStatus({text: 'Selected node: <b>' + record.data.text + '<br />', clear: false});"


here we have the page load of the .ascx file, where objectWS is an object containg due properties called "Name" and "Type":

Private Class objectWS
Private _name As String
Public Property Name() As String
Return _name
End Get
Set(ByVal value As String)
_name = value
End Set
End Property
Private _type As String
Public Property Type() As String
Return _type
End Get
Set(ByVal value As String)
_type = value
End Set
End Property
Public Sub New()
End Sub
Public Sub New(n As String, t As String)
_name = n
_type = t
End Sub
End Class

Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim root As New Ext.Net.Node
Dim objs As New List(Of objectWS)

root.Text = "Parameters"

objs.Add(New objectWS("user", "System.String"))
objs.Add(New objectWS("psw", "System.String"))

For Each ob As objectWS In objs
Dim node As New Ext.Net.Node
node.Text = ob.Name
If BaseType(ob.type) Then
node.Leaf = True
node.Icon = Icon.Add
node.CustomAttributes.Add(New Ext.Net.ConfigItem("Type", ob.Type, ParameterMode.Value))
node.CustomAttributes.Add(New Ext.Net.ConfigItem("Value", "", ParameterMode.Value))
node.Icon = Icon.Package
'addStruct(node, ob.type)
End If


Catch ex As Exception
End Try
End Sub

Private Function BaseType(type As String) As Boolean
If type = "System.String" Then
Return True
Return False
End If
End Function

And this is few javascript to refresh the node of the panel:

function valorizeTree(btn, text, node) {
if (btn == "ok" && (text != null || text != "")) {
node.data.Value = text;

function valorize(node) {
Ext.Msg.prompt('Set parameter', 'Write parameter value "' + node.data.text + '":', function (btn, text) { valorizeTree(btn, text, node); }, this, false);

The problem is that the value is correctly assigned to the field, but nothing is then visualized.
Here you have a small screenshot.


Thank you in advance.

Jan 29, 2014, 2:52 PM
Hi @PoloTheMonk,

A node's reload method should be used only if there is a TreeStore with a Proxy.

Please use the set method:

node.set("Value", text);
instead of

node.data.Value = text;

Also please note that this

doesn't do anything at all. To call a JavaScript function, the brackets are required.


Though, as I said, you should not use the reload method.

Jan 29, 2014, 3:42 PM
It works!

Thank you very much.