私の燃えさしバージョン:エンベロープでブートストラップ-3タイプヘッドを使用するには?
import Ember from 'ember';
export default Ember.TextField.extend({
didInsertElement: function() {
var _this = this;
this.$().typeahead({
source: function(query, process) {
$.getJSON("/api/" + _this.get('modelName'), {query: query, access_type: 'typeahead'}, function(data) {
process(data);
});
}
})
},
willDestroyElement: function() {
this.$().typeahead('destroy');
}
})
このコンポーネントを使用:
{{typeahead-input type="text" modelName='shipping_spaces' value=shippingSpace class="form-control"}}
そしてBootstrap-3-Typeahead
と、このコンポーネント作品(
DEBUG: -------------------------------
Ember : 2.11.0
Ember Data : 2.11.1
jQuery : 3.1.1
Ember Simple Auth : 1.2.0
DEBUG: -------------------------------
私はember data
を使用する前に、私はこのようなコンポーネントを持っていますhttps://github.com/bassjobsen/Bootstrap-3-Typeahead)。
私のプロジェクトにember-data
を使用すると、Bootstrap-3-Typeahead
の使用方法はわかりませんember-data
で動作します。すべてのデータがthis.store.query('order')
から届いたため、ajax
は使用しません。
typeahead
を使用する必要がある場合は、addo
を設計する必要がありますか?ありがとう。
感謝。完璧。 – JeskTop