atk4 / ui

Robust and easy to use PHP Framework for Web Apps
https://atk4-ui.readthedocs.io
MIT License
440 stars 105 forks source link

Add Model support for TreeItemSelector control source data #2023

Open mkrecek234 opened 1 year ago

mkrecek234 commented 1 year ago

The current implementation of TreeItemSelector requires a static array of nodes to display a tree. However, TreeItemSelector should also be usable with tree nodes in an Atk4/Model.

The included implementation offers an easy way to use any table which has tree items and references to a parent tree item id to build a dynamic tree.

It includes also an extended demo to show how it is being used. Given the usage of model data, this will also be a prerequisite to understand the typecasting issue stated in #2022

mkrecek234 commented 1 year ago

Can you check this PR please - I'd like to get the model support for TreeItemSelector pushed into PR. Desperately needed. Thank you