代码:
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 实现建议词模糊动态搜索功能,希望对大家有所帮助
如对本文有疑问, 点击进行留言回复!!
MFC的静态库.lib、动态库.dll(包含引入库.lib)以及Unicode库示例
CTF 刷题记录(一) 白云新闻搜索(手动与自动化SQL注入)
javascript如何使用函数random来实现课堂随机点名方法详解
网友评论