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

4 posts, 0 answers
  1. David
    David avatar
    48 posts
    Member since:
    Nov 2012

    Posted 15 Aug 2013 Link to this post

    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.
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 19 Aug 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David
    David avatar
    48 posts
    Member since:
    Nov 2012

    Posted 19 Aug 2013 Link to this post

    Genady,

    Thank you very much! I'll check it out and let you know. Dave.
  5. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 21 Aug 2013 Link to this post

    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.
Back to Top