Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

williamhector
Copy link

@williamhector williamhector commented Jul 25, 2019

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?

Technowl and others added 3 commits July 26, 2019 09:04
…d actions through the block yield hash.

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}}
Fixed linting issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants