2010-12-01 11 views
0

openイベントを使用して、ui == nullのときに "結果が見つかりません"を返すようにしたいが、openイベントが発生した後でも、結果があっても常に空です。jquery ui autocomplete - openイベント(結果が処理されない)

私のソースがXMLファイル

である私がしようとしています:

open: function(event,ui) { 
    if(ui.item == null) { 
    console.log("no results"); 
    } 
} 

答えて

0

autocomplete.jsに入れる:

if(retMatch.length == 0) { 
     var noResult = new Array(); 
     noResult[0] = { 
     label: "No results found", 
     title: "No results found", 
     description: "Your search did not return any results. Please refine your search criteria. If you believe this message is in error please fill out a support case." 
     } 
     return noResult; 
    } 

へ: $.extend

+1

は、このされませんプルダウンの[Now results founds]項目が選択可能なままになりますか?あなたが__renderMenuに自分自身を注入し、結果が「結果が見つかりません」であるときには選択できないように思えるようです – manu08

関連する問題