tree-multiselect.js icon indicating copy to clipboard operation
tree-multiselect.js copied to clipboard

Select sections/groups but not children

Open zampage opened this issue 7 years ago • 7 comments

Can I somehow select a section/group but not their children?

Like turn of allowBatchSelection but then add checkboxes to the sections/groups.

zampage avatar Jan 29 '18 15:01 zampage

Yes, onlyBatchSelection.

edit: hold on, you want to select just a section name? Then no, because there isn't a real option value associated with it.

patosai avatar Jan 29 '18 16:01 patosai

Yes exactly, I want to select only the section! Isn't there somehow a possibilty to do it? Maybe add a custom checkbox for the section after disabling onlyBatchSelection.

zampage avatar Jan 29 '18 16:01 zampage

Sorry, there's no method for doing that since there will be no change in the select element.

patosai avatar Jan 29 '18 17:01 patosai

You can select it kinda rough with this

  $("div.section div.title input").on('change', function(){
    alert( 'clicked!' );
  });

itorlakov avatar Mar 19 '18 14:03 itorlakov

I'm also looking for a way to select sections as well, is there a workaround for this?

bomsn avatar Jul 08 '18 18:07 bomsn

If anyone is still interested in this, what would the value of a 'section' be? This plugin tries not to modify the select DOM node, but if you want to extract a value for a section, there would need to be generated options added to the node.

patosai avatar May 17 '20 04:05 patosai

Still interested! Value could be the same as the nodename/sectionname (maybe with any prefix/suffix or both?!). Section of this Node is the parent Section.

something like: x prop1 Props x prop2 Props/Sec1 x prop3 Props/Sec2/Sec4 x [Sec3] Props

benhaze avatar Apr 27 '23 20:04 benhaze