0
我有一段代碼,當我的頁面加載有兩個獵犬數據源引導預輸入
//Bloodhound - Fetches all Project numbers for the current user
var prsysList = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.whitespace,
queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch: {
url: "../Helper/LookUpProjectNumber/",
cache: false
}
});
//Typeahead on project numbers
$('.typeahead').typeahead({
hint: true,
highlight: true,
minLength: 1
},
{
name: 'prsys',
source: prsysList
});
現在,當用戶選擇一個值,我想從後端獲取信息,根據他以前的選擇限制他未來的選擇。要做到這一點,我還有一個警犬返回我的信息的更新列表
//Bloodhound - Fetches all Project numbers for the current user
var newPrsysList = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.whitespace,
queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch: {
url: '../Helper/GetCommonPrsys?prsys=' + encodeURIComponent($selectedPrsys),
cache: false
}
});
//Init the new variable
newPrsysList.initialize();
//Rebind all Typeaheads on project numbers
$('.typeahead').typeahead({
hint: true,
higlight: true,
minlength: 1
},
{
name: 'prsys',
source: newPrsysList
});
我的問題是,儘管我的第二獵犬有數據可用的更新版本供用戶選擇,列表中的事實沒有被更新。
我在這裏做錯了什麼?
最佳