kartik-v / yii2-tree-manager

An advanced tree management module using nested sets for Yii 2.
http://demos.krajee.com/tree-manager
Other
150 stars 107 forks source link

Input Format for Kartik-v/yii2-tree-manager #224

Closed dazzlers1 closed 5 years ago

dazzlers1 commented 5 years ago

Hi, I am using 'kartik-v yii2-tree-manager'. In this I have to follow the same table structure as mentioned in the documentation. But I have different permissions for each sub-child. I have to combine 2 tables to display the tree node values. Is it possible to pass the data as an array so that I can write a new action to fetch data from both the tables. If it is possible let me know the array format. Now I am stuck with this. Please help.

kartik-v commented 5 years ago

yii2-tree-manager depends/relies on 'creocoder/yii2-nested-sets' extension for tree behavior management which uses a NestedSetsBehavior on a model typically mapped to a single table.

So you need to design your application accordingly. However the yii2-tree-manager provides a few abilities to dynamically control various such permission scenarios by allowing you to override the table level defaults at the Tree model level - by allowing you to override the methods like isActive, isMovable etc. within the model which can be used to get user id level accesses or data from other tables. Check the docs.