3
我試圖用基因敲除併發插件在我的項目,而我目前正與示例代碼擺弄,但我沒有得到它的工作:Knockout Concurrency插件可以跟蹤新添加或刪除的行嗎?
https://github.com/AndersMalmgren/Knockout.Concurrency/wiki/Getting-started
ViewModel = function() {
this.name = ko.observable("John").extend({ concurrency: true});
this.children = [{ name: ko.observable("Jane").extend({concurrency: true })}, { name: ko.observable("Bruce").extend({concurrency: true })}];
this.getData = function() {
//Simulate backend data
var data = { name: "John Doe", children: [{ name: "Jane Doe"},{ name: "Bruce Wayne"}, { name: "New row"}]};
new ko.concurrency.Runner().run(this, data);
}
}
ko.applyBindings(new ViewModel());
什麼也沒有發生,新添加的項目沒有被插件追蹤,有誰知道爲什麼?
嗯,好吧。我會試試看,謝謝。嘿,stackoverflow是一個小地方! – Max
我更新了Wiki,並在這方面也提供了一些信息。 https://github.com/AndersMalmgren/Knockout.Concurrency/wiki/Add-support-for-concurrency-conflicts-on-a-array-item-level – Anders