Skip to content

Commit fdca220

Browse files
author
Eugene Tupikov
committed
Add documentation about static input type and update example
1 parent 5f98e0a commit fdca220

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ use unclead\widgets\MultipleInput;
9595
'options' => [
9696
'class' => 'input-priority'
9797
]
98+
],
99+
[
100+
'name' => 'comment',
101+
'type' => 'static',
102+
'value' => function($data) {
103+
return Html::tag('span', 'static content', ['class' => 'label label-info']);
104+
},
105+
'headerOptions' => [
106+
'style' => 'width: 70px;',
107+
]
98108
]
99109
]
100110
]);

docs/images/multiple-column.gif

0 Bytes
Loading

examples/views/example.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@
7070
'options' => [
7171
'class' => 'input-priority'
7272
]
73+
],
74+
[
75+
'name' => 'comment',
76+
'type' => 'static',
77+
'value' => function($data) {
78+
return Html::tag('span', 'static content', ['class' => 'label label-info']);
79+
},
80+
'headerOptions' => [
81+
'style' => 'width: 70px;',
82+
]
7383
]
7484
]
7585
]);

src/MultipleInputColumn.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function renderCellContent($value)
178178
$input = Html::$type($name, null, $this->items, $options);
179179
break;
180180
case self::TYPE_STATIC:
181-
$input = $value;
181+
$input = Html::tag('p', $value, ['class' => 'form-control-static']);
182182
break;
183183
default:
184184
if (method_exists('yii\helpers\Html', $type)) {

src/assets/src/css/multiple-input.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ table.multiple-input-list tr > th {
2424
margin: 0 !important;
2525
}
2626
.multiple-input-list__item .label {
27-
margin-top: 8px;
2827
display: block;
2928
font-size: 13px;
3029
}

0 commit comments

Comments
 (0)