mrmuminov/yii2-combo-tree

Yii2 Combo Tree Select Extension

Installs: 26

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 1

Language:JavaScript

Type:yii2-extension

1.0.8 2022-04-10 13:16 UTC

This package is auto-updated.

Last update: 2024-05-10 18:06:56 UTC


README

Yii2 Combo Tree Select Extension

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist mrmuminov/yii2-combo-tree "*"

or add

"mrmuminov/yii2-combo-tree": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

<?= \MrMuminov\ComboTree\ComboTree::widget([
    'source' => [
        [
            'id' => 1,
            'title' => 'choice 1',
        ], 
        [
            'id' => 2,
            'title' => 'choice 2',
        ],
        [
            'id' => 3,
            'title' => 'choice 2 1',
            'parent_id' => 2,
        ], 
        [
            'id' => 4,
            'title' => 'choice 2 2',
            'parent_id' => 2,
        ], 
        [
            'id' => 5,
            'title' => 'choice 2 3',
            'parent_id' => 2,
        ], 
        [
            'id' => 6,
            'title' => 'choice 3',
        ], 
    ],
    'pluginOptions' => [
        'cascadeSelect' => false,
    ],
]); ?>

multiple single.png