ember-simple-tree icon indicating copy to clipboard operation
ember-simple-tree copied to clipboard

Allow for custom checkbox and expand icon components by passing through their required actions in the block yield.

Open williamhector opened this issue 6 years ago • 0 comments

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?

williamhector avatar Jul 25 '19 23:07 williamhector