私はバックボーン ビューを持っています。検索テキストフィールドで変更が発生するたびに、サーバーからブートストラップタイプアヘッドのデータソースを設定したい。これどうやってするの??これは私の検索ビューです
window.SearchByChoiceView = Backbone.View.extend({
initialize: function () {
this.model = new SearchByChoiceModel();
this.render();
},
render: function () {
$(this.el).empty().html(this.template(this.model.toJSON()));
return this;
},
});
window.SearchByChoiceModel = Backbone.Model.extend({
initialize: function () {
},
defaults: {
id: 1,
SearchKeyword: "",
"tags": new Array()
}
});
そして、これは私の検索フィールドです:
<input type="text" required placeholder="search" class="input-span3" id="SearchKeyword" title= "Search Keyword" name="SearchKeyword" value="<%= SearchKeyword %>" style="margin: 0 auto;" data-provide="typeahead" data-items="4">
誰か助けてください。背骨のあるビギナーです。簡単かもしれませんが、私にとっては扱いが非常に難しいです。私はたくさん試しました。