-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Ability to access selected elements in Tree view #49511
Comments
@chrisdias It seems you are asking for this requirement. I would like to know what is the use case behind it and also is it enough to get access to selected elements or you also need a selection change event? |
The simple case would be something like this. i want to add a "delete" button to the Docker explorer which would delete/remove a single image. I need to be able to get the selected item in the tree when clicking on the "X" command in the explorer title bar area. Selection change is not necessary in this scenario, but I could see how that might be interesting. Another scenario is the Azure App Service/Functions extension where you want to be able to select an app service, then click on the "deploy" action and deploy to that service. That way, you don't have to ask the user a bunch of questions on where to deploy to. //cc: @fiveisprime |
Thanks @chrisdias. Got it. I would expose |
@sandy081 If we can add icons to the toolbar(?) as shown in the screenshot above, a change event might address the issues I'd originally asked about dynamic context menus for - we could hook the change event and toggle some contexts, and apply those contexts to the actions on that toolbar? :) |
@DanTup not sure what you mean... I remember about the dynamic context menu issue but do not understand your comment related to it. Can you please add your comment in the issue related to dynamic context menu if it is nothing to do with this issue so that this will not get distracted. Thanks |
Added /**
* Currently selected elements.
*/
readonly selection: ReadonlyArray<T>; |
@sandy081 Sorry for the confusion; you asked above whether a change event was required. My comment was that if you do add a change event, it may solve the issue I had that I wanted the dynamic context menu for in a better way. So, my comment is basically a request for the change event :-) |
Commented in the issue related to dynamic menus. Lets discuss over there. |
Provide an API in
Treeview
to get selected elementsThe text was updated successfully, but these errors were encountered: