关闭

ComboBox下拉列表

507人阅读 评论(0) 收藏 举报
分类:

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

        }

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:126235次
    • 积分:1676
    • 等级:
    • 排名:千里之外
    • 原创:52篇
    • 转载:9篇
    • 译文:0篇
    • 评论:4条
    最新评论