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

How to remove check-box from tree view

Open Abdul-Quadar-Quazi opened this issue 6 years ago • 14 comments

I don't want check-box in the tree, How to make this working for my case. @leovo2708

instead of check box selection can we make on click the value should be emitted.

Abdul-Quadar-Quazi avatar Oct 18 '18 07:10 Abdul-Quadar-Quazi

Check this example: https://leovo2708.github.io/ngx-treeview/#/template

leovo2708 avatar Oct 18 '18 07:10 leovo2708

thanks for your response,

I have seen this example and I think you are suggesting me to use the template and instead of using ngx-dropdown-treeview component I should call ngx-treeview correct me if I am wrong.

Abdul-Quadar-Quazi avatar Oct 18 '18 07:10 Abdul-Quadar-Quazi

@leovo2708 it's working great, thanks!

Abdul-Quadar-Quazi avatar Oct 18 '18 13:10 Abdul-Quadar-Quazi

@Abdul-Quadar-Quazi @leovo2708 , Can you please tell me how to remove the checkboxes , i want a single node selection ?

brainyaashish avatar Jan 01 '19 08:01 brainyaashish

@brainyaashish you want single node selection for drop-down or just tree-view, if you want just tree-view then you must refer this example: https://leovo2708.github.io/ngx-treeview/#/template, and instead of drop-down tree selector just call tree view selector with some minor changes as your needs.

Abdul-Quadar-Quazi avatar Jan 01 '19 11:01 Abdul-Quadar-Quazi

@Abdul-Quadar-Quazi Thanks , i am using ngx-treeview not the dropdown one

<ngx-treeview class="treeview-container" [config]="config" [items]="items" (filterChange)="onFilterChange($event)" (selectedChange)="values = onSelectedChange($event)">

but i want a single selection , , Like if i can select a single node ( not multiple nodes as in checkbox) .

so how i can make this happen , which property i can modify og ngx-treeview to make it work for single selection only

brainyaashish avatar Jan 01 '19 11:01 brainyaashish

@brainyaashish pls refer to the example mentioned above thank you!

Abdul-Quadar-Quazi avatar Jan 01 '19 12:01 Abdul-Quadar-Quazi

@Abdul-Quadar-Quazi yes , Something like this https://hvt9eq.run.stackblitz.io

if you see single selection here https://www.telerik.com/kendo-angular-ui/components/treeview/selection/

brainyaashish avatar Jan 01 '19 12:01 brainyaashish

@Abdul-Quadar-Quazi @leovo2708 is it possible with ngx-treeview ? Please advise https://hvt9eq.run.stackblitz.io

if you see single selection here https://www.telerik.com/kendo-angular-ui/components/treeview/selection/

brainyaashish avatar Jan 01 '19 14:01 brainyaashish

image

here as user select one item or node -Ash lash for example and the selected text (Ash lash) i can select or see in console log

brainyaashish avatar Jan 01 '19 14:01 brainyaashish

@brainyaashish you can select or see in the console of one single node there is a property called (valueChange) which will emit you the value of selected tree node.

Abdul-Quadar-Quazi avatar Jan 02 '19 10:01 Abdul-Quadar-Quazi

@brainyaashish Hi, Could you please share your code? I am trying to get rid if the checkboxes in the treeview. Thanks in advance!

Avantikaa avatar Jun 13 '19 16:06 Avantikaa

Hi, can you please help in removing checkbox from the treeview. I don't need to perform any select operation on the treeview data, but I don't need the checkbox for the treeview data. Please suggest the code other than this example @leovo2708

Meghana-tech avatar Oct 25 '19 11:10 Meghana-tech

Well, can anyone suggest how to make the list to hide after single selection made? Right now if you click, the value displayed in input box, but the list with options are still open. Thank you

dmitryshah avatar Jan 21 '22 19:01 dmitryshah