ember-simple-tree
ember-simple-tree copied to clipboard
Allow for custom checkbox and expand icon components by passing through their required actions in the block yield.
Example:
{{#x-tree model=tree checkable=true recursiveCheck=true as |node|}}
<span class="node-checkbox {{if node.model.isChecked 'checked'}}" onclick={{action node.toggleCheck}}></span>
<span class="branch-toggle {{if node.model.isExpanded 'open'}}" {{action node.toggleExpand}}></span>
{{node.model.name}}
{{/x-tree}}
In order to support custom checkbox and expand icons, an alternative approach to this PR would be to allow implementing apps to toggle checkboxes and branch expansion by adding an onExpanded action, and to run recursive checkbox updates from manual model.isChecked updates instead of only from checkbox click actions. If this PR is rejected, is that alternative approach preferred?