mdmsoft/yii2-widgets 问题修复 & 功能扩展

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

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

mdmsoft/yii2-widgets

最新稳定版本:1.4

Composer 安装命令:

composer require mdmsoft/yii2-widgets

包简介

Widgets for Yii2

README 文档

README

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require mdmsoft/yii2-widgets "~1.0"

or add

"mdmsoft/yii2-widgets": "~1.0"

to the require section of your composer.json file.

Usage

TabularInput Widget

_form.php

<?php $form = ActiveForm::begin()?>
<table class="table">
    <thead>
        <tr>
            <th>&nbsp;</th>
            <th>&nbsp;</th>
            <th><a id="btn-add"><span class="glypicon glypicon-plus"></span></a></th>
        </tr>
    </thead>
<?= 
    TabularInput::widget([
        'id' => 'detail-grid',
        'allModels' => $model->items,
        'model' => OrderItem::className(),
        'tag' => 'tbody',
        'form' => $form,
        'itemOptions' => ['tag' => 'tr'],
        'itemView' => '_item_detail',
        'clientOptions' => [
            'btnAddSelector' => '#btn-add',
        ]
    ]);
?>
</table>

_item_detail.php

<td><?= $form->field($model,"[$key]product_id")->textInput()->label(false); ?></td>
<td><?= $form->field($model,"[$key]qty")->textInput()->label(false); ?></td>
<td><a data-action="delete"><span glypicon glypicon-minus></span></a></td>

GridInput Widget

<?= 
    GridInput::widget([
        'id' => 'detail-grid',
        'allModels' => $model->items,
        'model' => OrderItem::className(),
        'columns' => [
            ['class' => 'mdm\widgets\SerialColumn'],
            'product_id',
            'qty',
            [
                'attribute' => 'uom_id',
                'items' => [
                    1 => 'Pcs',
                    2 => 'Dozen'
                ]
            ],
            [
                'attribute' => 'tax',
                'type' => 'checkbox',
            ],
            ['class' => 'mdm\widgets\ButtonColumn']
        ],
    ]);
?>

统计信息

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

GitHub 信息

  • Stars: 17
  • Watchers: 7
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-08-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固