• Ext.NET 基础学习笔记06 (Ext.Net ComboBox用法)


    1.ComboBox简单用法

     <ext:ComboBox runat="server" ID="cmbUserList" DisplayField="Name" ValueField="ID">
                <Store>
                    <ext:Store runat="server" ID="storeUserInfo">
                        <Model>
                            <ext:Model runat="server" ID="Model1" IDProperty="ID">
                                <Fields>
                                    <ext:ModelField Name="ID" Type="Int"></ext:ModelField>
                                    <ext:ModelField Name="Name" Type="String"></ext:ModelField>
                                    <ext:ModelField Name="Gender" Type="String"></ext:ModelField>
                                    <ext:ModelField Name="Age" Type="Int"></ext:ModelField>
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
     </ext:ComboBox>

    C#后台代码:

    private void BindStore()
    {
          storeUserInfo.DataSource = UserInfo.GetData();
          storeUserInfo.DataBind();
    }

    2.ComboBox分页

    <ext:ComboBox runat="server" ID="cmbUserList" DisplayField="Name" ValueField="ID" PageSize="5">

    3.ComboBox自定义显示

    <ext:ComboBox runat="server" ID="cmbUserList" DisplayField="Name" ValueField="ID" PageSize="5">

               <Store>

                    <ext:Store runat="server" ID="storeUserInfo">
                        <Model>
                            <ext:Model runat="server" ID="Model1" IDProperty="ID">
                                <Fields>
                                    <ext:ModelField Name="ID" Type="Int"></ext:ModelField>
                                    <ext:ModelField Name="Name" Type="String"></ext:ModelField>
                                    <ext:ModelField Name="Gender" Type="String"></ext:ModelField>
                                    <ext:ModelField Name="Age" Type="Int"></ext:ModelField>
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <ListConfig>
                    <ItemTpl runat="server">
                        <Html>
                            <div>
                                <b>{Name}</b><br />
                                <span>年龄:{Age}</span>
                                <span>性别:{Gender}</span>
                            </div>
                        </Html>
                    </ItemTpl>
                </ListConfig>
     </ext:ComboBox>

    效果:

  • 相关阅读:
    MySQL(2)---Explain
    MySQL(1)---索引
    php 的 PHPExcel1.8.0 使用教程
    通过html5 的EventSource来进行数据推送
    centos6.6 下 安装 php7 按 nginx方式
    IIS PHP Warning: Unknown: open(c:\php\tmp\sess_xxx, O_RDWR) failed: Permission denied (13) in Unknown on line 0
    动态加载JS,并执行回调函数
    nginx 504 gateway time out
    php 账号不能同时登陆,当其它地方登陆时,当前账号失效
    php 函数中静态变量的问题
  • 原文地址:https://www.cnblogs.com/YuanDong1314/p/12980958.html
Copyright © 2020-2023  润新知