Closed larry-tx closed 5 years ago
You can add a new record to a blank new tree in two ways.
Option 1: First via the User interface... Only the Create New Root button (tree icon) will be enabled assuming you set allowNewRoots to true. Click this to add your first root record
Option 2: Via tree population db methods available in creocoder/yii2-nested-sets. This can be done when you have large number of records to migrate. Check the docs for yii2-nested-sets.
Actually, with regard to Option 1, I must not have been clear when I said, "All toolbar buttons are grayed (disabled)." All, in this case, includes the tree icon. Clicking on it does nothing. I did go back in, and added 'allowNewRoots' => true, to the widget even though your instructions make no mention of it. I cleared the browser history, refreshed the page, and the tree icon still does nothing.
and added 'allowNewRoots' => true, to the widget even though your instructions make no mention of it
Read about the widget properties - allowNewRoots ... when you have NO RECORDS the first record you add is typically a tree root.
On your other points will need to understand your issue clearly - you would need to find the way to populate ONE TIME MIGRATION records in your db tables... the db inserts/updates are controlled mainly by creocoder/yii2-nested-sets extension - and there are few ways you can do that - or even write your own db migration script.
I suppose updating to version 1.1.0 would resolve blank tree root creation problems. Check and let know.
Prerequisites
master
branch of yii2-tree-manager.Steps to reproduce the issue
Expected behavior and actual behavior
Be able to add records using the toolbar buttons.
When I follow those steps, I see... The left panel with toolbar buttons at the bottom. All toolbar buttons are grayed (disabled). When I click them, nothing happens. The mouse cursor does not change to a hand when I hover over them. I was expecting... To be able to add a record by clicking the plus button.
In researching on Google, I found one posting wherein the person said that it would work if you added an initial record manually with: root=1, rgt=1, lft=1, lvl=0, name=SomeName. When I did that, I got this error message: Calling unknown method: backend\modules\associations\models\AssociationCategories::parents()
Environment
Browsers
Operating System
Libraries
Isolating the problem