webanimals / dynatree

Automatically exported from code.google.com/p/dynatree
0 stars 0 forks source link

Support mixing radio and checkbox nodes in same tree and toggling select state for both #474

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What new or enhanced feature are you proposing?

Minor enhancement to handle selecting of both radio and checkbox nodes mixed in 
same tree. Currently only nodes having class matching classNames.checkbox are 
selected by onClick() handler.

Add new default option:
  classNames:{
    ...
    radio:"dynatree-radio",
    ...
  }

Modify getEventTargetType() (line 790 in v1.2.5):
  from:
    } else if ( tcn.indexOf(cns.checkbox) >= 0 ) {
  to:
    } else if ( tcn.indexOf(cns.checkbox) >= 0 || tcn.indexOf(cns.radio) >= 0 ) {

No harmful side-effects observed so far.

What goal would this enhancement help you achieve?

Simplifies user code when using both radio and checkbox classes for nodes based 
on user data by enabling onClick() to recognize both as a "checkbox" target and 
toggle select state.

User code then only has to handle the high level onSelect event to manage radio 
nodes.

Original issue reported on code.google.com by me...@goolrick.us on 11 Feb 2014 at 5:58

GoogleCodeExporter commented 9 years ago

Original comment by moo...@wwwendt.de on 13 Feb 2014 at 6:57

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r697.

Original comment by moo...@wwwendt.de on 13 Feb 2014 at 6:59