ComboBox下拉列表

@*----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;

        }

阅读更多
个人分类: Ext
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

ComboBox下拉列表

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭