2017 © Pedro Peláez
 

yii2-extension yii2-sortable-tree

The Tree widget based on Jquery-sortable-list,drag and drop to sort the tree.

image

xiongchuan/yii2-sortable-tree

The Tree widget based on Jquery-sortable-list,drag and drop to sort the tree.

  • Monday, December 26, 2016
  • by xiongchuan86
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 10 % Grown

The README.md

Sortable Tree Widget for Yii 2

The Sortable Tree widget based on Jquery-sortable-list,drag and drop to sort the tree., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist xiongchuan/yii2-sortable-tree "*"

or add, (*4)

"xiongchuan/yii2-sortable-tree": "*"

to the require section of your composer.json., (*5)

Usage

Once the extension is installed, simply add widget to your page as follows:, (*6)

 [
                ['title' => 'Category 1'],
                ['title' => 'Category 2'],
                [
                    'title' => 'Category 3',
                    'children' => [
                        [
                            'title' => 'Category 3.1',
                        ],
                        [
                            'title' => 'Category 3.2',
                            'children' => [
                                [
                                    'title' => 'Category 3.2.1',
                                ]
                            ],
                            'folder' => true,
                        ],
                    ],
                    'folder' => true,
                ],

            ],
            'clientOptions' => [
                'autoCollapse' => true,
                'clickFolderMode' => 3,
                'activate' => new \yii\web\JsExpression('
                        function(node, data) {
                              node  = data.node;
                              // Log node title
                              console.log(node.title);
                        }
                '),
            ],
        ]); ?>

The Versions

26/12 2016

dev-master

9999999-dev

The Tree widget based on Jquery-sortable-list,drag and drop to sort the tree.

  Sources   Download

MIT

The Requires

  • bower-asset/jquery-sortable-lists *

 

by chuan xiong

extension yii2 tree sortable drap and drop