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