This is a migrated thread and some comments may be shown as answers.

Has anyone ever used Knockout.js to bind to a TreeView?

3 Answers 136 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 16 Aug 2013, 03:39 AM
I'm using knockout to bind a view model to DOM elements.  This works great for basic HTML controls so I was wondering if their custom bindings feature could be used when TreeView nodes are checked/unchecked to update the underlying ViewModel or to check/uncheck TreeView checkboxes when the VM changes.

Thanks, Dave.

3 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 19 Aug 2013, 05:21 PM
Hello David,

It is possible to use KO with with RadTreeView. I've toyed a bit with this and created a sample project where on page load we create ViewModel that binds to the checkboxes rendered by each RadTreeNode. So changing the check state of the node updates the ViewModel and vice versa. You can find the project attached to this thread. I hope that it helps.

Regards,
Genady Sergeev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
David
Top achievements
Rank 1
answered on 19 Aug 2013, 08:50 PM
Genady,

Thank you very much! I'll check it out and let you know. Dave.
0
Genady Sergeev
Telerik team
answered on 21 Aug 2013, 07:24 AM
Hello David,

No problem. We will appreciate any feedback you might have.

Regards,
Genady Sergeev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
TreeView
Asked by
David
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
David
Top achievements
Rank 1
Share this question
or