call a function on node checked event

2 posts, 0 answers
  1. John
    John avatar
    5 posts
    Member since:
    Jun 2014

    Posted 29 Jun 2014 Link to this post

    I would like to call a JavaScript function when a nodes' checkbox is clicked so that I can update anther control on screen. There is not a "OnChecked" event, so is it possible ?

    Any help appreciated,
    John
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 30 Jun 2014 Link to this post

    Hello John,


    Indeed there is no built in onChecked event. Since the checked state of the items is stored in the dataSource, you could bind to it's change event to handle the checking (unchecking) of the items.
    E.g.
    $(function () {
        var treeview = $("#treeview").data("kendoTreeView");
        treeview.dataSource.bind("change", function (e) {
            if (e.field == "checked") {
                //an item was checked/unchecked
            }
        });
    });

    I hope this information helps.

    Regards,
    Dimiter Madjarov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top