-
Notifications
You must be signed in to change notification settings - Fork 76
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
Option to change checkbox behaviour in tree with selectionMode="ancestors" #3608
Labels
0 - new
New issues that need assignment.
blocked
This issue is blocked by another issue.
c-tree
Issues that pertain to the calcite-tree and related components
enhancement
Issues tied to a new feature or request.
Milestone
Comments
moosetraveller
added
0 - new
New issues that need assignment.
enhancement
Issues tied to a new feature or request.
needs triage
Planning workflow - pending design/dev review.
labels
Dec 1, 2021
moosetraveller
changed the title
Option to change checkbox behaviour in tree with ancestors
Option to change checkbox behaviour in tree with selectionMode="ancestors"
Dec 1, 2021
WorkaroundHere is a workaround to use buttons inside the tree: <calcite-tree selection-mode="ancestors" lines>
<calcite-tree-item *ngFor="let ds of datasets;">
{{ds.label}}
<calcite-tree slot="children">
<div *ngFor="let data of ds.data;" style="display: flex;">
<calcite-tree-item [attr.value]="data.id" style="flex-grow: 5; margin-left: 0.25rem;">
{{data.label}}
</calcite-tree-item>
<!-- "focus border" of the buttons will be wrong -->
<calcite-button (click)="zoomTo(data.id)" style="margin-left: 0.25rem;" color="neutral"
icon-start="layer-zoom-to" appearance="transparent"></calcite-button>
<calcite-button (click)="showInfo(data.id)" style="margin-left: 0.25rem;" color="neutral"
icon-start="information" appearance="transparent"></calcite-button>
</div>
</calcite-tree>
</calcite-tree-item>
</calcite-tree> // _tree is a reference to the tree element instance (HTMLCalciteTreeElement)
_tree.addEventListener('calciteTreeSelect', (event: any) => {
let selection = event.detail.selected.map((selection: HTMLCalciteTreeItemElement) => {
return selection.getAttribute("value");
})
.filter((value: string) => {
return value != null;
});
// do something with selection
}); Note: I am using Angular. |
@asangma seems like a good place for the "list item slot paradigm" with slots for content-end. |
Related #3127 |
This depends on #2884. |
13 tasks
macandcheese
added
the
c-tree
Issues that pertain to the calcite-tree and related components
label
Aug 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
0 - new
New issues that need assignment.
blocked
This issue is blocked by another issue.
c-tree
Issues that pertain to the calcite-tree and related components
enhancement
Issues tied to a new feature or request.
Description
At the moment, when using a tree with
selectionMode="anchestors"
, I cannot add action buttons to acalcite-tree-item
and, since everything is within a label, it's a pain to format the item.Ways to solve this:
selectionMode="none"
so developers can add their own checkboxes (suggested here: Enhancement: [calcite-tree] add selection-mode "none" #3121)Workarounds
UseEvent.stopPropagation()
in action button's click event handler to stop event propagation. (not yet tested)Acceptance Criteria
see description
Relevant Info
Which Component
Tree
Example Use Case
I would like to provide actions to the user (for example: zoom to layers extent, show metadata in a dialog and so on). In my workflow, a user selects data for a geoprocessing service and would like to have a peek on the data or read the metadata before continuing.
The text was updated successfully, but these errors were encountered: