<?php echo \mcms\xeditable\XEditableText::widget(['model' => $val, 'placement' => 'right', 'url' => 'employees/updateposition', 'pluginOptions' => ['name' => 'position', 'id' => 'empID'], 'callbacks' => ['validate' => new \yii\web\JsExpression(' function(value) { if($.trim(value) == "") { return "This field is required"; } } ')]]); ?> </td> <td> <?php echo \mcms\xeditable\XEditableTextArea::widget(['model' => $val, 'placement' => 'right', 'url' => 'employees/updateskills', 'pluginOptions' => ['name' => 'skills', 'id' => 'empID'], 'callbacks' => ['validate' => new \yii\web\JsExpression(' function(value) { if($.trim(value) == "") { return "This field is required"; } } ')]]); ?> </td> <td> </td> </tr> <?php } ?> </tbody>
use yii\helpers\ArrayHelper; use kartik\widgets\Select2; ?> <?php foreach ($searchData as $val) { ?> <tr> <td> <?php echo date('d-m-Y', strtotime($val->transactionDate)); ?> </td> <td> <?php echo \mcms\xeditable\XEditableTextArea::widget(['model' => $val, 'placement' => 'right', 'url' => 'transactions/updatelgdescription', 'pluginOptions' => ['name' => 'particular', 'id' => 'ID']]); ?> </td> <td> <?php if ($val->debit == 0) { $val->amount = number_format($val->credit); echo \mcms\xeditable\XEditableText::widget(['model' => $val, 'placement' => 'right', 'url' => 'transactions/updateamount', 'pluginOptions' => ['name' => 'amount', 'id' => 'ID'], 'callbacks' => ['validate' => new \yii\web\JsExpression(' function(value) { if($.trim(value) == "") { return "This field is required"; } } ')]]); } else { $val->amount = number_format($val->debit);