Page 1 of 1

How to Implement Lazy Loading with TreeSelect?

Posted: 28 Apr 2021, 08:32
by wolificus
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.

Re: How to Implement Lazy Loading with TreeSelect?

Posted: 07 May 2021, 00:44
by mert.sincan
Hi,

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

Best Regards,