pascini/yii2-gantt-column 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

pascini/yii2-gantt-column

Composer 安装命令:

composer require pascini/yii2-gantt-column

包简介

Ganttchart-Column for yii2 grid for project-management

README 文档

README

Yii2

Latest Stable Version Total Downloads Latest Unstable Version License

Gantt-Column widget for Yii Framework 2.0 grid extends the data column. It could be used for project management or other planings. The widget incorporates with Bootstrap 3.x.

ganttColumnScreenshot

Installation

The preferred way to install this extension is through composer.

Prerequisite

You must set the minimum-stability to dev in the composer.json file in your application root folder before installation of this extension.

Install

You can directly run

$ php composer.phar require rottriges/yii2-gantt-column "1.0.*"

or you add the following to to the require section of your composer.json file.

"rottriges/yii2-gantt-column": "1.0.*"

Usage

Model with dataProvider:

namespace app\models;

use yii\data\ArrayDataProvider;

class GanttTest extends \yii\base\Model
{
  public function getDataProvider()
  {
      $testArray = [
        [
          'task' => 'Project planing',
          'type' => 'primary',
          'START_DATE' => '2020-10-19',
          'END_DATE' => '2020-11-07'
        ],
        [
          'task' => 'Production',
          'type' => 'danger',
          'START_DATE' => '2020-11-15',
          'END_DATE' => '2021-03-29'
        ],
        [
          'task' => 'Release',
          'type' => 'success',
          'START_DATE' => '2021-04-05',
          'END_DATE' => '2021-04-06'
        ],
      ];
     return new ArrayDataProvider([
          'allModels' => $testArray,
          'pagination' => [
              'pageSize' => 0,
          ],
        ]
      );
  }
}

View:

use yii\grid\GridView;

echo GridView::widget([
  'dataProvider' => $model->dataProvider,
  'columns' => [
    [
      'attribute' => 'gantChart'
      'class' => 'rottriges\ganttcolumn\GanttColumn',
      'ganttOptions' => [
        // start or endDateRange can either be a static date (Y-m-d)
        // or an offset in weeks to the current date (-2, 0, 5, ...)
        // 'dateRangeStart' => '2019-10-31',
        // 'dateRangeEnd' => '2020-10-01',
        'dateRangeStart' => -4,
        'dateRangeEnd' => 28,
        'startAttribute' => 'START_DATE',
        'endAttribute' => 'END_DATE',
        // progressBarType [string | closure] possible values
        // primary, info, warning or danger.
        'progressBarType' => function($model, $key, $index) {
          return $model['type'];
        }
        // progressBarColor [string | closure]
        // css color property
        // if color is set progressbar type will be overwritten
        'progressBarType' => function($model, $key, $index) {
          return $model['type'];
        }
      ]
    ],
  ],
]);

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2021-11-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固