Skip to content

Commit dbfa697

Browse files
author
Eugene Tupikov
committed
Fix #17 display inline for input
1 parent 4c81a67 commit dbfa697

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/MultipleInputColumn.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ class MultipleInputColumn extends Object
6969
*/
7070
public $headerOptions = [];
7171

72+
/**
73+
* @var bool whether to render inline error for the input. Default to `false`
74+
*/
75+
public $enableError = false;
76+
77+
/**
78+
* @var array the default options for the error tag
79+
*/
80+
public $errorOptions = ['class' => 'help-block help-block-error'];
81+
7282
/**
7383
* @var MultipleInput
7484
*/
@@ -197,9 +207,14 @@ public function renderCellContent($value, $index)
197207
return $input;
198208
}
199209

210+
if ($this->enableError) {
211+
$input .= "\n" . Html::tag('div', '', $this->errorOptions);
212+
}
213+
200214
$input = Html::tag('div', $input, [
201215
'class' => 'form-group field-' . $options['id'],
202216
]);
217+
203218
return Html::tag('td', $input, [
204219
'class' => 'list-cell__' . $this->name,
205220
]);

0 commit comments

Comments
 (0)