Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
Add / remove the css on igtree node click event
posted

I want to apply the checkbox css to igtree on node click event. How can i achieve this? Please guide me.

I have used below code

nodeClick: function (evt, ui) {
// $('.customClass').removeClass('customClass'); // Remove the class from the previous element it has been applied to

// if (ui.element.hasClass('ui-igtree-node-nochildren')) // if the node is a leaf node apply the class

ui.element.addClass('ui-igcheckbox-small .ui-icon,.ui-igcheckbox-normal .ui-icon,.ui-iggrid th .ui-igcheckbox-normal.ui-state-default .ui-icon,.ui-igcombo-checkbox .ui-icon{background-image: url(../images/tickTrue.png)!important;width:17px;height:17px;position:absolute');

//}
}

Parents
No Data
Reply
  • 80
    posted

    I use this modification

    var checkBoxes = $("span[data-role='checkbox']");

    $.each(checkBoxes, function (key, value) {
    if (this.parentNode.dataset.path.length == 5) {// 1-3-5-7... the path length if separator is 1 char long
    //$(this).css("display", "none"); // if you do not want them at all
    $(this).css("visibility", "hidden"); // if you want to easiliy unhide later
    }
    });

Children
No Data