Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Expand/Collapse tree node without selecting node
posted

Hi,

I'm using the igx-tree for navigation purpose in my project - so far so good. But I'm facing with the situation when I expand a node the related node will be selected - like in the doc www.infragistics.com/.../tree

But this is a behavior that I don't want. My requirement is, that the user can click on the expand/collapse symbol but current selected node should not change.

How can I change this behavior.

THX

Parents
No Data
Reply
  • 460
    Offline posted

    Hello,

    From your description, it seems like you’re referring to the visual indication (border) around the nodes in the igx-tree component when they are selected. If your goal is to prevent the selected node's appearance from changing when expanding or collapsing other nodes, I recommend using a CSS approach to remove the border.

    You can apply the following style to make the border transparent:

    igx-tree {
        --igx-tree-border-color: transparent;
    }

    This will ensure that no border is displayed when a node is clicked, preserving the visual state of the currently selected node even as others are expanded or collapsed.

    The described scenario could be observed here:

     

    For a practical demonstration, I’ve created a sample project where this styling is implemented. You can view it here: View Sample.

    Please review the sample and let me know if it meets your requirements or if there are any additional customizations you’d like to discuss. I’m happy to help with any further adjustments or questions!

    Regards,

    Georgi Anastasov

    Entry Level Software Developer

    Infragistics

Children