2017 © Pedro Peláez
 

yii2-extension yii2-widgets

Widgets for Yii2

image

mdmsoft/yii2-widgets

Widgets for Yii2

  • Sunday, March 12, 2017
  • by mdmunir
  • Repository
  • 7 Watchers
  • 15 Stars
  • 2,757 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 5 Versions
  • 3 % Grown

The README.md

yii2-widgets

Installation

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

Either run, (*2)

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

or add, (*3)

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

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

Usage

TabularInput Widget

_form.php, (*5)

<?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, (*6)

<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']
        ],
    ]);
?>

The Versions

12/03 2017

dev-master

9999999-dev

Widgets for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

by Misbahul Munir

yii widgets tabular input

12/03 2017

1.2

1.2.0.0

Widgets for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

by Misbahul Munir

yii widgets tabular input

22/02 2016

1.1

1.1.0.0

Widgets for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

by Misbahul Munir

yii widgets tabular input

22/01 2015

1.0.0

1.0.0.0

Widgets for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

by Misbahul Munir

yii widgets tabular input

03/11 2014

1.0.0.rc

1.0.0.0-RC

Widgets for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

by Misbahul Munir

yii widgets tabular input