• Ext js 下拉框下拉的同时输入模糊查询


     var joincmpcombo = new Ext.form.ComboBox({//设计师
                        id: 'joincmp_name',
                        name: 'joincmp_name',
                       hiddenName: 'joincmp', //后台获取的是id的值
                        fieldLabel: '联盟商',
                        valueField: 'joincmp_id', //ComboBox的值,如果提交表单,这个值是要传到后台的
                        displayField: 'joincmp_name', //这个是下拉框显示的值
                        allowBlank: true, //是否允许为空
                        blankText: '请选择联盟商', //为空显示的值
                        triggerAction: 'all', //显示所有下拉框的值
                        typeAhead:true,
                        store: joincmp,
                        anchor: '95%',
                        mode: 'local'  ,//必须用本地加载
                        editable:true,
                        queryParam:'text',
                        listeners : {
                            'beforequery':function(e){
                                var combo = e.combo;   
                                if(!e.forceAll){   
                                    var value = e.query; 
                                    var regExp = new RegExp(".*" + value + ".*");  
                                    combo.store.filterBy(function(record,id){   
                                        var text = record.get(combo.displayField);   
                                        return regExp.test(text);   
                                    });//alert(0);
                                    combo.expand();
                                    return false;
                                }
                            }
                        }
                    });
  • 相关阅读:
    Java中的Date类型无法赋值给数据库的datetime类型
    在HTML中改变input标签中的内容
    sizeof计算类的大小
    UML类图,转载
    大端小段详解—转载
    leetcode练习
    linux基础
    排序算法和查找算法

    链表
  • 原文地址:https://www.cnblogs.com/hais/p/4175278.html
Copyright © 2020-2023  润新知