How to Implement Lazy Loading with TreeSelect?

UI Components for React
Post Reply
wolificus
Posts: 1
Joined: 08 Apr 2021, 16:34

28 Apr 2021, 08:32

I'd like to use lazy loading with the new TreeSelect component. It has a "leaf" property that's documented as being "used for lazy loading." I have a list of childless TreeNodes. When leaf = false, I can click on the node and it will show a blue circle. When leaf = true, it just selects the node. Is there a way to click on the node and lazy-load its child nodes? The onNodeExpand event doesn't fire unless the node already has children. Code sandbox: https://codesandbox.io/s/pqzmt?file=/sr ... Select.tsx.

Edit: I got more details running this in my own environment. Setting the 'leaf' property to false enables the expand/collapse button, but the onNodeExpand event never fires.

mert.sincan
Posts: 4710
Joined: 29 Jun 2013, 12:38

07 May 2021, 00:44

Hi,

Fixed for the next version. Details; https://github.com/primefaces/primereact/issues/1995

Best Regards,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests