当前位置:编程学习 > html/css >>

TreePanel 选择值回传父页

HTML:


[html]  <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Property2.aspx.cs" Inherits="DzPlatForm.CRM.Property.Property2" %> 
 
<%@ 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> 
    <link rel="stylesheet" type="text/css" href="../../resources/css/main.css" /> 
    <script type="text/javascript"> 
        //树 单击取值主键FID 
        function ClickNode(node) { 
            if (node.hasChildNodes()) { //判断是否有子节点 
 
            } 
            else { 
 
                var t = node.attributes.text; 
                var v = node.attributes.id; 
 
                parent.txtPropertyName_2.setValue(t); 
                parent.txtProperty_2.setValue(v); 
                parent.WinCustClass.hide(); 
            } 
        } 
    </script> 
</head> 
<body> 
    <form id="form1" runat="server"> 
 <ext:ResourceManager ID="ResourceManager1" runat="server" /> 
    <ext:TreePanel ID="TreePanel1" runat="server" Icon="ApplicationHome" Height="450" 
        Shadow="None" UseArrows="true" AutoScroll="true" Animate="true" EnableDD="true" 
        ContainerScroll="true" RootVisible="false"> 
        <Root> 
        </Root> 
    </ext:TreePanel> 
    </form> 
</body> 
</html> 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Property2.aspx.cs" Inherits="DzPlatForm.CRM.Property.Property2" %>

<%@ 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>
    <link rel="stylesheet" type="text/css" href="../../resources/css/main.css" />
    <script type="text/javascript">
        //树 单击取值主键FID
        function ClickNode(node) {
            if (node.hasChildNodes()) { //判断是否有子节点

            }
            else {

                var t = node.attributes.text;
                var v = node.attributes.id;

                parent.txtPropertyName_2.setValue(t);
                parent.txtProperty_2.setValue(v);
                parent.WinCustClass.hide();
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
 <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:TreePanel ID="TreePanel1" runat="server" Icon="ApplicationHome" Height="450"
        Shadow="None" UseArrows="true" AutoScroll="true" Animate="true" EnableDD="true"
        ContainerScroll="true" RootVisible="false">
        <Root>
        </Root>
    </ext:TreePanel>
    </form>
</body>
</html>

CS:


[csharp]  using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Data; 
using System.Data.SqlClient; 
using Ext.Net; 
using DzPlatForm.DBUtility; 
 
namespace DzPlatForm.CRM.Property 

    public partial class Property2 : System.Web.UI.Page 
    { 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            if (!X.IsAjaxRequest) 
            { 
                //读取来源数据表  
                string strSql = string.Format("SELECT [Id],[ParentId],[Name] FROM [CustomerClass]"); 
                DataTable dt = new DataTable(); 
                dt = SqlHelper.ExecuteDataset(SqlHelper.conn, CommandType.Text, strSql).Tables[0]; 
                if (dt.Rows.Count > 0) 
                { 
        &nb

补充:web前端 , HTML/CSS  ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,