[Tree] Expand / Collapse using the entire label

UI Components for React
Post Reply
ShahinLotfi
Posts: 1
Joined: 16 Feb 2021, 15:07

16 Feb 2021, 18:43

Hi,

I'm using a basic Tree component with a custom nodeTemplate. I was wondering if there is a way to expand/collapse using the label, and not just the toggler. Any and all help is greatly appreciated!

Code: Select all

	const nodeTemplate = (node) => {
	        <div>
	        <!-- Use this button expand/collapse
	         <button>{node.label}</button>
        	</div>
        }
        
	<Tree
		value={menuData}
		className="dropdownTree"
		nodeTemplate={nodeTemplate}
    	/>
Also, thank you for an awesome component library!

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests