各アイテムがサーバーからデータを取得し、このデータを含むコンボボックスを作成します。現在進行中のことは、同じデータを持つ3つのコンボボックスがあることです。私はこのコードを持っている各ループでフェッチを待つ方法
:私には
self.CollectionTest.each(function(item, index) {
if (item.attributes.QuesAnswerType == 7) {
self.dtype = item.attributes.QuesAnswerValue_Para;
self.dropdowncollection = new QuestionaireDetailsCollection;
self.dropdowncollection.fetch({
reset: true,
url: 'api/Variables/getPara',
data: $.param({ type: self.dtype }),
success: function() {
self.dropdowndataSource = new kendo.Backbone.DataSource({
collection: self.dropdowncollection,
});
var cbid = "cb" + item.attributes.Id;
$('<input id="' + cbid + '" dataTextField: "Name" dataValueField: "Id" data-bind="value:QuesDetAnswer"/>')
.appendTo("#divrb" + item.attributes.Id)
.kendoDropDownList({
dataTextField: "Name",
dataValueField: "Id",
dataSource: self.dropdowndataSource,
autoBind: true,
});
} // end of success
});
こんにちは、リストのレンダリングをラップ、ウル提案が働いていた...ありがとうとよろしく – Lili