extjs--combox用法

本文介绍了如何使用Ext.js框架创建一个下拉列表框组件,用于选择拟文人,包括配置组件属性、事件处理及异常情况处理。
ExpandedBlockStart.gif代码
 1   //                    //拟文人
 2                     //                    //用来定义选择拟文人的下拉列表框
 3                     //                    var nwrComboStore = new Ext.data.Store({
 4                     //                        id: 'nwrComboStore',
 5                     //                        proxy: new Ext.data.HttpProxy({ url: 'dealData.aspx?Param=nwrCombo' }),
 6                     //                        reader: pubReader
 7                     //                    });
 8                     //                    //用来显示在新增窗口的panel中
 9                     //                    var _nwrCombo = new Ext.form.ComboBox({
10                     //                        id: 'nwrCombo',
11                     //                        queryParam: 'name', //查询的名字  
12                     //                        allQuery: '', //查询全部信息的查询字符串
13                     //                        loadingText: '正在加载拟文人信息,请稍后...', //加载数据时显示的提示信息 
14                     //                        minChars: 1, //下拉列表框自动选择前用户需要输入的最小字符数量 
15                     //                        queryDelay: 500, //查询延迟时间
16                     //                        store: nwrComboStore,
17                     //                        tpl: '<tpl for="."><div ext:qtip="{text}" class="x-combo-list-item">{text}</div></tpl>', //每一项的提示信息
18                     //                        editable: true, //可输入
19                     //                        typeAhead: true,
20                     //                        emptyText: '请选择',
21                     //                        mode: 'remote',
22                     //                        triggerAction: 'all',
23                     //                        valueField: 'value',
24                     //                        displayField: 'text',
25                     //                        fieldLabel: '拟文人*',
26                     //                        labelStyle: "color:red;",
27                     //                        // listWidth:450,//dropdownlist的宽度
28                     //                        //resizable: true,
29                     //                        allowBlank: false,
30                     //                        blankText: "你必须选择拟文人",
31                     //                        forceSelection: true, //限制只能输入下拉列表中的文本
32 
33                     //                        //        hiddenName: 'value',  //后台要接收的值 
34                     //                        pageSize: 20
35 
36                     //                    });
37                     //                    //在新增窗口,如果通过查询字符串查询不到拟文人,将做如下处理。
38                     //                    nwrComboStore.on('load', function() {
39                     //                        if (nwrComboStore.getTotalCount() == 0) {
40                     //                            Ext.Msg.alert("提示", "该拟文人不存在,请重新选择。");
41                     //                            _nwrCombo.reset();
42                     //                        }
43                     //                    });

 

转载于:https://www.cnblogs.com/oversky/archive/2010/02/08/1665899.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值