I am working on a list which has tasks and subtasks (nested list).. I am implementing KO Sortable in it. Sortable just works fine but when I try to add new task, it does not simply work..

I am using mapping with the following code :

    self.Tasks = ko.mapping.fromJS(dummyData);

Here is the JSfiddle I am working on :

http://jsfiddle.net/rahulrulez/z9fJV/7/

How can I solve the issue?

I also want to add subtasks directly, is there any better way to do it?

One more thing I will be doing in advance. I need to track the priority order in future

Please help me with it :-) Thanks a ton in advance..

有帮助吗?

解决方案

1) In one place, you have "observable" spelled as "observble".

2) In ko.applyBindings, you need to instantiate your VM with new.

3) Your click bindings for getSelectedTask need to be qualified with $root because it's not a method of the individual task models.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top