0
绑定到多个jQueryUI的对话,我希望能够控制无jQueryUI的对话从淘汰赛如何控制和淘汰赛
我已经看到了你可以从这里淘汰赛控制的对话: Error with latest knockout and jquery ui dialog: cannot call prior to initialization
在该讯息的对话controled在更新处理:
update:ko.utils.unwrapObservable(allBindingsAccessor().dialogVisible);
$(element).dialog(shouldBeOpen ? "open" : "close");
是否有共识,你会如何控制多个对话的状态观察到的,像这样:
isAddOpen: KnockoutObservableBool = ko.observable(false);
isEditOpen: KnockoutObservableBool = ko.observable(false);
openEditDialogue(editingItem) {
this.editingItem = editingItem;
this.isEditOpen(true);
}
closeEditDialogue(editingItem) {
this.editingItem = editingItem;
this.isEditOpen(true);
}
openAddDialogue() {
this.isAddOpen(true);
}
closeAddDialogue() {
this.isAddOpen(false);
}
我可以重复与另一个绑定处理程序的逻辑,但我宁愿坚持只是一个。
这简直是一等! – FutuToad 2013-03-05 16:06:15