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

Toolbar buttons disabled #208

Closed larry-tx closed 5 years ago

larry-tx commented 5 years ago

Prerequisites

Steps to reproduce the issue

  1. Installed "kartik-v/yii2-tree-manager": "dev-master"
  2. Followed instructions at http://demos.krajee.com/tree-manager meticulously, copying and pasting wherever possible.
  3. Displayed index.php in Chrome and Firefox browsers.

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

kartik-v commented 5 years ago

You can add a new record to a blank new tree in two ways.

larry-tx commented 5 years ago

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.

kartik-v commented 5 years ago

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.

kartik-v commented 5 years ago

I suppose updating to version 1.1.0 would resolve blank tree root creation problems. Check and let know.