PDA

View Full Version : [CLOSED] Click tree note to refresh gridpanel...



gs_user
Jun 07, 2012, 9:53 AM
Hi,
When Tree node was click, send seleted node text to refresh gridpanel
but code can't work
How to resolve ????

Treepanel1.Listeners.Click.Handler in Ext.net 2.0 can't use ,what code to replace it???



<ext:TreePanel ID="TreePanel1" runat="server" Height="600" Title="mytree">
<Listeners>
<ItemClick Handler="App.direct.GetSel(#{TreePanel1}.getSelectionModel( ).getSelectedNode().text);">
</ItemMouseEnter>
</Listeners>

</ext:TreePanel>

Daniil
Jun 07, 2012, 10:21 AM
Hi,

Please use SelectionModel.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:TreePanel ID="TreePanel1" runat="server" AutoHeight="true">
<Root>
<ext:Node Text="Root (level 0)" Expanded="true">
<Children>
<ext:Node Text="Node1 (level 1)" Expanded="true">
<Children>
<ext:Node Text="Node1 (level 2)" Expanded="true">
<Children>
<ext:Node Text="Node1 (level 3)" Leaf="true" />
<ext:Node Text="Node2 (level 3)" Leaf="true" />
</Children>
</ext:Node>
</Children>
</ext:Node>
<ext:Node Text="Node2 (level 1)" Expanded="true">
<Children>
<ext:Node Text="Node1 (level 2)" Expanded="true">
<Children>
<ext:Node Text="Node1 (level 3)" Leaf="true" />
<ext:Node Text="Node2 (level 3)" Leaf="true" />
</Children>
</ext:Node>
</Children>
</ext:Node>
</Children>
</ext:Node>
</Root>
<SelectionModel>
<ext:TreeSelectionModel runat="server">
<Listeners>
<Select Handler="alert(record.get('text'));" />
</Listeners>
</ext:TreeSelectionModel>
</SelectionModel>
</ext:TreePanel>
</body>
</html>

gs_user
Jun 08, 2012, 2:41 AM
thanks for your help :)


Hi,

Please use SelectionModel.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:TreePanel ID="TreePanel1" runat="server" AutoHeight="true">
<Root>
<ext:Node Text="Root (level 0)" Expanded="true">
<Children>
<ext:Node Text="Node1 (level 1)" Expanded="true">
<Children>
<ext:Node Text="Node1 (level 2)" Expanded="true">
<Children>
<ext:Node Text="Node1 (level 3)" Leaf="true" />
<ext:Node Text="Node2 (level 3)" Leaf="true" />
</Children>
</ext:Node>
</Children>
</ext:Node>
<ext:Node Text="Node2 (level 1)" Expanded="true">
<Children>
<ext:Node Text="Node1 (level 2)" Expanded="true">
<Children>
<ext:Node Text="Node1 (level 3)" Leaf="true" />
<ext:Node Text="Node2 (level 3)" Leaf="true" />
</Children>
</ext:Node>
</Children>
</ext:Node>
</Children>
</ext:Node>
</Root>
<SelectionModel>
<ext:TreeSelectionModel runat="server">
<Listeners>
<Select Handler="alert(record.get('text'));" />
</Listeners>
</ext:TreeSelectionModel>
</SelectionModel>
</ext:TreePanel>
</body>
</html>