Ext JS 实现建议词模糊动态搜索功能

时间:2017-05-13    点击:257   

代码:

new Ext.form.ComboBox({
 store: new Ext.data.JsonStore({
 idProperty: 'VehicleNo',
 url: '../ajax/test.ashx,
 fields: ['VehicleNo', 'phoneNum']
 }),
 id:'querynodesid',
 emptyText:'快速检索',
hiddenName: 'VehicleNo',
 displayField: 'VehicleNo',
 valueField: 'VehicleNo',
 queryParam: 'VehicleNo',
 forceSelection: true,
 hideTrigger: true,
 queryDelay: 500,
 width:100,
 enableKeyEvents: true,
 minChars: 1,
 mode: 'remote',
 listeners: {
 'select': {
 fn: function (combo, record, index)
 {
 var no = Ext.get("querynodesid").dom.value;
 findByKeyWordFiler2(no);
 }
 }
 }
 })

参数说明:

queryParam: 'VehicleNo',参数为输入的值 会以VehicleNo参数传入后台,可自定义;

test.ashx? 返回的参数格式为[{"VehicleNo":"00001","phoneNum":"000002"},{},{}];

'select' 为当选择某个数据的时候需要执行的回调;

这种方法适用数据量小的搜索,如果数据量比较大的搜索可能会影响到性能

以上所述是小编给大家介绍的Ext JS 实现建议词模糊动态搜索功能,希望对大家有所帮助,如果大家有任何疑问欢迎给我留言,小编会及时回复大家的!

Jquery把获取到的input值转换成json
jQuery实现radio第一次点击选中第二次点击取消功能
jQuery返回定位插件详解
一个可复用的vue分页组件
Node.JS文件系统解析实例详解
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved