码迷,mamicode.com
首页 > Web开发 > 详细

Extjs combo search, extjs Combox做查询

时间:2015-03-05 17:19:12      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:extjs combo search   extjs combo做查询   

// The data store containing the list of states

var states = Ext.create(‘Ext.data.Store‘, {

    fields: [‘abbr‘, ‘name‘],

    data : [

        {"abbr":"AL", "name":"AlOabama"},

        {"abbr":"AK", "name":"Alaska"},

        {"abbr":"AZ", "name":"Arizona"}

        //...

    ]

});


// Create the combo box, attached to the states data store

Ext.create(‘Ext.form.ComboBox‘, {

    fieldLabel: ‘Choose State‘,

    store: states,

    queryMode: ‘local‘,

    displayField: ‘name‘,

    valueField: ‘abbr‘,

    typeAhead : true,

    editable : true,

    renderTo: Ext.getBody(),

    hideTrigger:true,//将combo的下拉框图标去掉

    listeners : {

        beforequery : function(record){

            record.query = new RegExp(record.query, ‘i‘);//这里的“i”表示不区分大小写

            record.forceAll = true;

        }

    }

});


技术分享

Extjs combo search, extjs Combox做查询

标签:extjs combo search   extjs combo做查询   

原文地址:http://angelgirl.blog.51cto.com/1695763/1617656

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!