ngx-treeview icon indicating copy to clipboard operation
ngx-treeview copied to clipboard

Question on firing .open or .toggle from outside the ngx-dropdown-treeview

Open bogeorge opened this issue 6 years ago • 1 comments

I have used your examples to build custom single and multi select drop downs. I sometimes need to show them in "read only" mode and so I was trying to be "fancy" with a version like this. The idea is the combo shows as disabled (so it matches other types of controls). However, if there are 2+ items selected I wanted have a link to show the drop down anyway.

image

In my click handler I've tried the two below and neither opens the drop down. I've debugged and see them getting into dropdown.directive.ts and firing open.

this.dropdownTreeviewComponent.dropdownDirective.toggle(); this.dropdownTreeviewComponent.dropdownDirective.open();

Not, in my drop down header I also have a button that takes some action and then fires .close() and this seems to work fine.

My initial thought is this may be because my "show selections" is outside the actual ngx-dropdown-tree and therefore doesn't know "what to open" where as my close is inside it so it can. Any thoughts suggestions?

bogeorge avatar Jun 18 '18 19:06 bogeorge

I have used your examples to build custom single and multi select drop downs. I sometimes need to show them in "read only" mode and so I was trying to be "fancy" with a version like this. The idea is the combo shows as disabled (so it matches other types of controls). However, if there are 2+ items selected I wanted have a link to show the drop down anyway.

image

In my click handler I've tried the two below and neither opens the drop down. I've debugged and see them getting into dropdown.directive.ts and firing open.

this.dropdownTreeviewComponent.dropdownDirective.toggle(); this.dropdownTreeviewComponent.dropdownDirective.open();

Not, in my drop down header I also have a button that takes some action and then fires .close() and this seems to work fine.

My initial thought is this may be because my "show selections" is outside the actual ngx-dropdown-tree and therefore doesn't know "what to open" where as my close is inside it so it can. Any thoughts suggestions?

Hey George. Did you find the solution? Can you share your code? How do you use the directive? Thanks

dmitryshah avatar Jan 24 '22 14:01 dmitryshah