hierarchy-select icon indicating copy to clipboard operation
hierarchy-select copied to clipboard

Remove selected value

Open 128yusuf opened this issue 5 years ago • 1 comments

How to remove selected value from hierarchy

128yusuf avatar Aug 19 '20 05:08 128yusuf

You can add your own id attribute to the <a> element:

<a id="item-33" class="dropdown-item" data-value="4" data-level="3" href="#">White</a>

And use javascript:

const element = document.getElementById('item-33');
element.hidden = true;   // to hide element
element.remove();        // or removed it

Also you can find it via querySelectorAll":

document.querySelectorAll('[data-value]')[3].hidden = true

Why do we need some additional internal functionality to remove elements? Or do you mean the need to delete the entire branch of the hierarchy?

kaperusov avatar Sep 25 '22 08:09 kaperusov