Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to create a tree checkbox?

3357899Dec 5 2016 — edited Dec 6 2016

Hello,

How to create a tree checkbox?

I try to make tree checkbox.

<div id="tree" style="width: 180px;height: auto;"

           data-bind="ojComponent:

           {

             component: 'ojTree',

             selectionMode: 'multiple',

             data:{data: getJson}

           }">

</div>

$("#tree").on("ojoptionchange", function(e, ui) {

             $("#tree" + ' li').each(function () {

               var checkbox = $('\<input type="checkbox" class="treeCheckbox">');

               checkbox.attr('data-tree\_id', $("#tree").attr('id'));

               $("#tree").prepend(checkbox);

             });

             if (ui.option == "selection") {

               // show selected nodes

               var selected = \_arrayToStr(ui.value) ;

               $("#results").text("id = " + selected) ;

             }

});

Result :

스크린샷 2016-12-06 오전 10.15.49.png

But I want to make it like this picture :

스크린샷 2016-12-06 오전 9.34.25.png

Comments

Post Details

Added on Dec 5 2016
1 comment
241 views