multiselecttree API/lazy loading

1 Answer 74 Views
MultiSelect
Mahesh
Top achievements
Rank 1
Iron
Mahesh asked on 18 Oct 2023, 07:11 PM

Need an example of multi-select tree API data.

Found Similar for Dropdown - https://stackblitz.com/edit/react-gr9hn2?file=app%2Fmain.jsx

 

 

1 Answer, 1 is accepted

Sort by
0
Wissam
Telerik team
answered on 20 Oct 2023, 12:28 PM

Hi, Mahesh,

I prepared an example that simulated an API call for the MultiSelectTree component by loading a `loadingPanel` component to the MultiSelectTree element when an item is expanded.

In the below demo, I added the loadingPanel to the MultiSelectTree element using ReactDOM.createPortal in the LoadingPanel component. In addition, I am setting the `loading` state variable to true in the `onExpandChange` event handler and in that case the panel will appear since it is rendered conditionally with the `loading` variable.

Moreover, in the onExpandChange method, I am setting a 1000ms timeout in order to simulate an API call. Inside the `setTimeout` method, I am setting the new expanded state and `loading` to false:

Please check the above example and let me know if it matches what you need.

Regards,
Wissam
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Mahesh
Top achievements
Rank 1
Iron
commented on 23 Oct 2023, 11:59 AM

Thank you so much. Appreciate it.
Wissam
Telerik team
commented on 23 Oct 2023, 12:02 PM

You are welcome, Mahesh. I am glad that my reply was helpful to you.

Tags
MultiSelect
Asked by
Mahesh
Top achievements
Rank 1
Iron
Answers by
Wissam
Telerik team
Share this question
or