Ext.Net.SelectBox菜单联动

后台:
private void init()
        { 
	    DataTable gzflDt = bll.GetGZFLSelectBoxList();
            Store3.DataSource = gzflDt;//工作分类
            Store3.DataBind();
            if (gzflDt.Rows.Count > 0)
            {
                this.SelectBoxgzfl.SelectedIndex = 0;
                //任务分类
                rwflMethod(gzflDt.Rows[0]["ID"].ToString());
            }
	}

	/// <summary>
        /// 任务分类
        /// </summary>
        /// <param name="gzflId"></param>
        protected void rwflMethod(string gzflId)
        {
            DataTable rwflDt = bll.GetRWFLSelectBoxList(gzflId);
            Store4.DataSource = rwflDt;//任务分类
            Store4.DataBind();
            if (rwflDt.Rows.Count > 0)
            {
                //任务分类
                this.SelectBoxrwfl.SelectedIndex = 0;
            }

        }

	protected void cbtype_change(object sender, DirectEventArgs e)
        {
            if (this.SelectBoxgzfl.SelectedItem.Value != "")//菜单叶子
            {
                rwflMethod(this.SelectBoxgzfl.SelectedItem.Value);
            }


        }
	前台:
	<td align="center" valign="middle" class="table-td6">
                                        工作分类<font color="red">*</font>
                                    </td>
                                    <td align="left" valign="middle" class="table-td4">
                                        <ext:SelectBox ID="SelectBoxgzfl" runat="server" Width="170" ValueField="ID" DisplayField="CLASSNAME">
                                            <Store>
                                                <ext:Store ID="Store3" runat="server">
                                                    <Reader>
                                                        <ext:JsonReader IDProperty="ID">
                                                            <Fields>
                                                                <ext:RecordField Name="ID" Type="Int" />
                                                                <ext:RecordField Name="CLASSNAME" />
                                                            </Fields>
                                                        </ext:JsonReader>
                                                    </Reader>
                                                </ext:Store>
                                            </Store>
                                            <DirectEvents>
                                                <Select OnEvent="cbtype_change">
                                                </Select>
                                            </DirectEvents>
                                        </ext:SelectBox>
                                    </td>

 			<td align="center" valign="middle" class="table-td5">
                                        任务分类<font color="red">*</font>
                                    </td>
                                    <td align="left" valign="middle" class="table-td4">
                                        <ext:SelectBox ID="SelectBoxrwfl" runat="server" Width="170" ValueField="ID" DisplayField="CLASSNAME">
                                            <Store>
                                                <ext:Store ID="Store4" runat="server">
                                                    <Reader>
                                                        <ext:JsonReader IDProperty="ID">
                                                            <Fields>
                                                                <ext:RecordField Name="ID" Type="Int" />
                                                                <ext:RecordField Name="CLASSNAME" />
                                                            </Fields>
                                                        </ext:JsonReader>
                                                    </Reader>
                                                </ext:Store>
                                            </Store>
                                        </ext:SelectBox>
                                    </td>

实现效果图:

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值