Hi,
I'm using Treeview checkboxes with MVVM and SPA. I have a ListView that contains every checked treeview node element ( a copy , to be precise). The Listview shows them with a remove button in a template. When the user click the remove button , the application deletes it from the ListView ( By removing the element from an observable array), but , I have also to uncheck this element from the TreeView. The ListView is in different View from the TreeView. In this situation, my problems are these:
1. When I set the "checked" property from the observableHierarchy object to false, the TreeView doesn't reflect the change, using MVVM I thought that the binding was in both ways.
2. Because The TreeView and the ListView are in differents views (or pages), I can't use something like this
In the moment when the remove button is pressed there wont be #treeview element.
3. Using methods that break the MVVM pattern (I save the uid from the li element and use these as selector like in the point 2 ), I can uncheck the treeview nodes, but , another problem emerges. Apparently , using Jquery to uncheck a node doesn't change the datasource , so for kendo even if the node is unchecked , in the datasource the "checked" property for that node remains equals true, so when I re-check the node, the "change" event for the observableHierarchy doesn't fire, because the checked value is already "true".
So there is a easy way to acomplish these?
I'm using Treeview checkboxes with MVVM and SPA. I have a ListView that contains every checked treeview node element ( a copy , to be precise). The Listview shows them with a remove button in a template. When the user click the remove button , the application deletes it from the ListView ( By removing the element from an observable array), but , I have also to uncheck this element from the TreeView. The ListView is in different View from the TreeView. In this situation, my problems are these:
1. When I set the "checked" property from the observableHierarchy object to false, the TreeView doesn't reflect the change, using MVVM I thought that the binding was in both ways.
2. Because The TreeView and the ListView are in differents views (or pages), I can't use something like this
$(
"#treeview .k-checkbox input"
).eq(0).attr(
"checked"
, false
)
3. Using methods that break the MVVM pattern (I save the uid from the li element and use these as selector like in the point 2 ), I can uncheck the treeview nodes, but , another problem emerges. Apparently , using Jquery to uncheck a node doesn't change the datasource , so for kendo even if the node is unchecked , in the datasource the "checked" property for that node remains equals true, so when I re-check the node, the "change" event for the observableHierarchy doesn't fire, because the checked value is already "true".
So there is a easy way to acomplish these?