Aug 11, 2010, 12:12 PM
[CLOSED] How to get checked/selected nodes of a Treepanel/MultiSelectionModel from codebehind?
How can I get the SelectedNodes of a MultiSelectionModel?
I have this page:
Regards,
Klaus
I have this page:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="uc_event._Default" %>
<%@ 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></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="rsm01" runat="server" ScriptMode="Debug" />
<ext:Panel ID="def_pnlwuc01" runat="server" Layout="Fit" Title="UserControl" Icon="ApplicationViewDetail">
<Items>
<ext:DropDownField ID="ucde01_Cmb_CusBusRe" runat="server" Editable="false" Width="240"
TriggerIcon="SimpleArrowDown" Mode="ValueText" >
<Component>
<ext:TreePanel ID="ucde01_Trp_CusBusRe" runat="server" Title="Kundenbeziehungen" Icon="Accept"
Height="300" Shadow="None" UseArrows="true" AutoScroll="true" Animate="true"
EnableDD="true" ContainerScroll="true" RootVisible="false">
<Root>
<ext:TreeNode>
<Nodes>
<ext:TreeNode Text="To Do" Icon="Folder">
<Nodes>
<ext:TreeNode Text="Go jogging" Leaf="true" Checked="False" />
<ext:TreeNode Text="Take a nap" Leaf="true" Checked="False" />
<ext:TreeNode Text="Clean house" Leaf="true" Checked="False" />
</Nodes>
</ext:TreeNode>
<ext:TreeNode Text="Grocery List" Icon="Folder">
<Nodes>
<ext:TreeNode Text="Bananas" Leaf="true" Checked="False" />
<ext:TreeNode Text="Milk" Leaf="true" Checked="False" />
<ext:TreeNode Text="Cereal" Leaf="true" Checked="False" />
</Nodes>
</ext:TreeNode>
</Nodes>
</ext:TreeNode>
</Root>
<SelectionModel>
<ext:MultiSelectionModel ID="ucde01_Msm_CusBusRe" runat="server" />
</SelectionModel>
</ext:TreePanel>
</Component>
<Listeners>
<Expand Handler="this.component.getRootNode().expand(true);" Single="true" Delay="10" />
</Listeners>
</ext:DropDownField>
<ext:Button ID="Button1" runat="server" Icon="Disk">
<DirectEvents>
<Click OnEvent="det_tobbtnsave_Click" Timeout="300000">
<EventMask ShowMask="true" />
</Click>
</DirectEvents>
<ToolTips>
<ext:ToolTip ID="ToolTip1" runat="server" Html="Click on Save Button to read checked items" />
</ToolTips>
</ext:Button>
</Items>
</ext:Panel>
</form>
</body>
</html>
and this codebehind code:Partial Public Class _Default
Inherits System.Web.UI.Page
Public Sub det_tobbtnsave_Click(ByVal sender As Object, ByVal e As Ext.Net.DirectEventArgs)
For i = 0 To ucde01_Msm_CusBusRe.SelectedNodes.Count - 1
Next
End Sub
End Class
and ucde01_Msm_CusBusRe.SelectedNodes is always NOTHING!Regards,
Klaus
Last edited by Daniil; Aug 12, 2010 at 2:08 PM.
Reason: [CLOSED]