定制 andkon/yii2dynatree 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

andkon/yii2dynatree

Composer 安装命令:

composer require andkon/yii2dynatree

包简介

Tree widget for Yii2

README 文档

README

docs:
    http://wwwendt.de/tech/dynatree/
demo:
    http://andkon.bl.ee/index.php?r=store

install:

php composer.phar require "andkon/yii2dynatree": "dev-master"

Как использовать/How to use

Model:
need attributes:
    id - primary key
    parent_id - FK to id
    sort - INT order in tree
    name - STRING as label
you can override the field names 
attribs
$pkField 
$parentField 
$sortField 

Controller:
class UnitController extends Controller
{
    ...
    public function actions()
    {
        $actions               = parent::actions();
        $actions['moveintree'] = 'andkon\yii2dynatree\actions\MoveInTree';
        
        // or
        $actions['moveintree'] = [
            'class' => andkon\yii2dynatree\actions\MoveInTree',
            'sortField' => 'order', // override field name
        ];

        return $actions;
    }
    ...
}

Widget:
class Tree extends \andkon\yii2dynatree\Tree
{
    public function init()
    {
        parent::init();
        $this->functions['onClick'] = 'function (node, event) {
            unit.showDetal(node.data.key);
        }';
    }
}

View:
echo \app\pathToWidget\Tree::widget(
    [
        'id'      => 'treeId',
        'isAjax'  => true, // true for use ajax load widget (in dialog|popup etc.) or false for standart render
        'ajaxUrl' => Yii::$app->getUrlManager()->createUrl('/pathToController/moveintree'),
        'model'   => $model,
    ]
);

统计信息

  • 总下载量: 4.97k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: JavaScript

其他信息

  • 授权协议: proprietary
  • 更新时间: 2014-08-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固