Allow TreeItems to have optional checkboxes
See original GitHub issueI’m all for trying to avoid webviews as much as possible, especially when tree views are hard to make work in a webview. This proposal allows for treeviews to have checkboxes:
(but better styling of course 😄)
Scenarios
- To-do list extensions
- Applying filters where an ‘Edit’ button drops you into the experience above where checkboxes show up
- Crafting
.gitignore
’s or other ‘ignores’ where you go down the filesystem and uncheck the files you want to ignore
Proposal
- TreeItem has new optional property called
checkboxState
similar tocollapsibleState
which takes in aTreeItemCheckBoxState
:
export class TreeItem {
// ...
/**
* [TreeItemCheckboxState](#TreeItemCheckboxState) of the tree item.
*/
checkboxState?: TreeItemCheckboxState;
// ...
}
/**
* Checkbox state of the tree item
*/
export enum TreeItemCheckboxState{
/**
* Determines an item can be neither checked nor unchecked. Implies it has no checkbox.
*/
None = 0,
/**
* Determines an item is checked
*/
Checked = 1,
/**
* Determines an item is unchecked
*/
Unchecked = 2
}
TreeDataProvider
will have a new optional eventonDidChangeTreeCheckbox
which will fire when the checkbox of aTreeItem
is checked or unchecked:
/**
* A data provider that provides tree data
*/
export interface TreeDataProvider<T> {
// ...
/**
* An optional event to signal that an element or root has either been checked or unchecked.
*/
onDidChangeTreeCheckbox?: Event<ChangeTreeCheckboxEvent<T>>;
// ...
}
export interface ChangeTreeCheckboxEvent {
/**
* The item that was checked or unchecked.
*/
readonly item: <T>;
/**
* Removed workspace folders.
*/
readonly newState: TreeItemCheckboxState;
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:31
- Comments:11 (6 by maintainers)
Top Results From Across the Web
JavaFX: CheckBoxTreeItem item not selected when checked
1) Selecting the TreeItem does not change the selected state of the CheckBox. · 2) I have created a ChangeListener that listens to...
Read more >How to only let the child nodes can be checked in UI for WPF
As we know, The treeview control enables check boxes for all nodes. Is it possible to show the check boxes for sepecific nodes?...
Read more >ARIA: treeitem role - Accessibility - MDN Web Docs - Mozilla
A treeitem that is not a parent is an end node. Tree items that have children can be expanded or collapsed, showing and...
Read more >Apex 18.1 using Checkboxes in a tree - Oracle Communities
I have a question about the new tree region (with Checkboxes) in Apex 18.1 : ... treeView("option","multiple", true) // make the tree support...
Read more >Add Checkbox Selection to APEX Tree Region
Hopefully you have already converted to the APEX Tree implementation. ... The treeView widget has an option to enable multiple selection.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
API-review:
onDidChangeTreeCheckbox
should becomeonDidChangeCheckboxState
You should see this appear on our August iteration plan 😃. We’ll start looking into it then.