I'm wondering how I can add a button (or a parent checkbox) to the following code to do Select All and Deselect All in the checkbox.
function selectVols() { $("#volumesContainer").show(); $("#volumesContainer").dialog(); var tree = $('#tree').tree({ primaryKey: 'id', uiLibrary: 'bootstrap4', dataSource: menu, selectionType: 'multiple', checkboxes: true }); tree.on('checkboxChange', function (e, $node, record, state) { var vol; if (state != 'indeterminate') { $.each(volumes, function (i, e) { if (e.name == record.text) { vol = e; } }); if (vol != undefined) { if (state == 'checked') { draw(vol); } else { clear(vol); } } } }); I am very new to jquery and there seems to be many ways to do this on the Internet but none are close enough to the code I have been given to get a solution. Thank you!