代碼:
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); } } } })參數(shù)說明:
queryParam: 'VehicleNo',參數(shù)為輸入的值 會以VehicleNo參數(shù)傳入后臺,可自定義;
test.ashx? 返回的參數(shù)格式為[{"VehicleNo":"00001","phoneNum":"000002"},{},{}];
'select' 為當選擇某個數(shù)據(jù)的時候需要執(zhí)行的回調;
這種方法適用數(shù)據(jù)量小的搜索,如果數(shù)據(jù)量比較大的搜索可能會影響到性能
以上所述是小編給大家介紹的Ext JS 實現(xiàn)建議詞模糊動態(tài)搜索功能,希望對大家有所幫助,如果大家有任何疑問歡迎給我留言,小編會及時回復大家的!
新聞熱點
疑難解答