ComboBox下拉列表

原创 2013年12月04日 10:24:16

@*----ComBox操作-----*@

<script>

 @*Ext.onReady(function () {

       //姓名下拉列表数据

        var dsUsers = new Ext.data.Store({

            proxy: new Ext.data.HttpProxy({

                url:'@Url.Action("GetUser", "ExtDemo")'

            }),

            reader: new Ext.data.JsonReader({

                root: 'Rows',

                id: 'id'

            }, [

                { name: 'id' },

                { name: 'text' }

            ])

        });

 

       //UI显示

        var tabs = new Ext.TabPanel({

            renderTo: 'tabs',

            activeTab: 0,

            frame: true,

            defaults: { autoHeight: true },

            items: [

                //拉合作方式服务产品关系

                new Ext.Panel({

                    title: '关联合作方式与服务产品',

                    frame: true,

                    bodyStyle: 'padding:5px 5px0',

                    width: 700,

                    layout: 'form',

                    labelWidth: 80,

                    layoutConfig: { columns: 1},

                    items: [

                        new Ext.form.ComboBox({

                            id: 'Name',

                            //hiddenName:'GUID',

                            valueField: 'id',

                            fieldLabel: '姓名',

                            store: dsUsers,

                            displayField:'text',

                            typeAhead: false,

                            loadingText: '查找中...',

                            minChars: 1,

                            width: 300,

                            pageSize: 10,

                            hideTrigger: true,

                            queryParam: 'key',

                            allowBlank: false,

                            value:'@Model.Name'

                        }),

                        new Ext.form.ComboBox({

                            id: 'Name1',

                            //hiddenName:'HZAreaID',

                            valueField: 'id',

                            fieldLabel: '姓名',

                            store: dsUsers,

                            displayField:'text',

                            typeAhead: false,

                            loadingText: '查找中...',

                            minChars: 1,

                            width: 200,

                            pageSize: 10,

                            hideTrigger: true,

                            queryParam: 'key',

                            listeners: {

                                'select':function (combo, record, index) {

 

                                }

                            }

                        }),

                        //按服务产品刷选

                        new Ext.form.ComboBox({

                            id: 'Name2',

                            valueField: 'id',

                            fieldLabel: '姓名',

                            store: dsUsers,

                            displayField:'text',

                            width: 200,

                            mode: 'local',

                            editable: true,

                            triggerAction:'all',

                            listeners: {

                                'select':function (combo, record, index) {

 

                                }

                            }

                        }),{

                            name:"paymnetitem",

                            id:"Name3",

                            xtype:"combo",

                            fieldLabel: "姓名",

                            readOnly: true,

                            mode:"local",

                            displayField:"text",

                            valueField:"messagetype",

                            triggerAction:"all",

                            store: dsUsers

                        }

 

                    ]

                })

            ]

        })//-----------TabPanel

   });*@

 

</script>

 

 

后台

//获得类型 下拉

       public stringGetMSType()

        {

           string json = "";

           JavaScriptSerializer jss = new JavaScriptSerializer();

           BLL.MessageType bllbd = new BLL.MessageType();

           List<Model.MessageType>mtlist = new List<Model.MessageType>();

           mtlist = bllbd.GetModelList("");

           if (mtlist.Count > 0)

            {

                var b =mtlist.Select(m => new

               {

                   text = m.MessageTypeName,

                   id = m.Id

               });

               json = jss.Serialize(b);

            }

           return json;

        }

相关文章推荐

【WPF】给下拉列表ComboBox绑定数据

设置ItemSource绑定到List< 实体类 >

WPF 下拉列表框ComboBox扩展控件

  • 2016年04月26日 16:38
  • 105KB
  • 下载

在DataGridView控件中加入ComboBox下拉列表框的实现

在DataGridView控件中加入ComboBox下拉列表框的实现  虽然在Visual Studio中 DataGridView控件的DataGridViewComboBoxColumn可以实现下...

EasyUI ComboBox(下拉列表框)

ComboBox(下拉列表框) 扩展自$.fn.combo.defaults。使用$.fn.combobox.defaults重写默认值对象。 下拉列表框显示一个可编辑文本框和下拉式列表,用户可以...

ExtJS ComboBox 下拉列表详细用法

原文转自起飞网:http://www.qeefee.com/article/000171 ComboBox 是ExtJS中经常用到的控件,今天我们来讲一下它的一些用法。 使用本地Store ...

在DataGridView控件中加入ComboBox下拉列表框的实现

虽然在Visual Studio中 DataGridView控件的DataGridViewComboBoxColumn可以实现下拉列表框,但这样的列会在整列中都显示下拉列表框,不太美观,而且还要用代码...
  • biyusr
  • biyusr
  • 2012年05月14日 09:02
  • 737

可输入可联想的下拉列表的实现——Ext ComboBox

 网上这样的控件不少,有很多实现方法,其中不少的很巧妙。    例如:在文本框(HTML INPUT)后,添加一个隐藏层,隐藏层上放一个下拉列表,存储了所有可能的元素,每次文本框触发onpropert...

在DataGridView控件中加入ComboBox下拉列表框的实现

原文 http://www.cnblogs.com/luqingfei/archive/2007/03/28/691372.html 虽然在Visual Studio中 DataGridView控...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:ComboBox下拉列表
举报原因:
原因补充:

(最多只允许输入30个字)