Closed yohanesluhur closed 4 years ago
i got error when install and run the gridview : -Undefined variable: viewMsg -Undefined variable: updateMsg -Undefined variable: deleteMsg -Undefined variable: scrollingTop
Here are my script :
<?php
use yii\helpers\Html; use kartik\grid\GridView;
/ @var $this yii\web\View / / @var $searchModel app\models\KaryawanSearch / / @var $dataProvider yii\data\ActiveDataProvider /
$this->title = 'Karyawans'; $this->params['breadcrumbs'][] = $this->title; ?>
= Html::a('Create Karyawan', ['create'], ['class' => 'btn btn-success']) ?>
" . $model->color . '
i got error when install and run the gridview : -Undefined variable: viewMsg -Undefined variable: updateMsg -Undefined variable: deleteMsg -Undefined variable: scrollingTop
Here are my script :
<?php
use yii\helpers\Html; use kartik\grid\GridView;
/ @var $this yii\web\View / / @var $searchModel app\models\KaryawanSearch / / @var $dataProvider yii\data\ActiveDataProvider /
$this->title = 'Karyawans'; $this->params['breadcrumbs'][] = $this->title; ?>
= Html::encode($this->title) ?>
= Html::a('Create Karyawan', ['create'], ['class' => 'btn btn-success']) ?>
render('_search', ['model' => $searchModel]); ?> = GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'kartik\grid\ExpandRowColumn'], [ 'class' => 'kartik\grid\EditableColumn', 'attribute' => 'name', 'pageSummary' => 'Page Total', 'vAlign'=>'middle', 'headerOptions'=>['class'=>'kv-sticky-column'], 'contentOptions'=>['class'=>'kv-sticky-column'], 'editableOptions'=>['header'=>'Name', 'size'=>'md'] ], [ 'attribute'=>'color', 'value'=>function ($model, $key, $index, $widget) { return "" . $model->color . '
'; }, 'filterType'=>GridView::FILTER_COLOR, 'vAlign'=>'middle', 'format'=>'raw', 'width'=>'150px', 'noWrap'=>true ], [ 'class'=>'kartik\grid\BooleanColumn', 'attribute'=>'status', 'vAlign'=>'middle', ], [ 'class' => 'kartik\grid\ActionColumn', 'dropdown' => true, 'vAlign'=>'middle', 'urlCreator' => function($action, $model, $key, $index) { return '#'; }, 'viewOptions'=>['title'=>$viewMsg, 'data-toggle'=>'tooltip'], 'updateOptions'=>['title'=>$updateMsg, 'data-toggle'=>'tooltip'], 'deleteOptions'=>['title'=>$deleteMsg, 'data-toggle'=>'tooltip'], ], ['class' => 'kartik\grid\CheckboxColumn'] ], 'containerOptions' => ['style'=>'overflow: auto'], 'beforeHeader'=>[ [ 'columns'=>[ ['content'=>'Header Before 1', 'options'=>['colspan'=>4, 'class'=>'text-center warning']], ['content'=>'Header Before 2', 'options'=>['colspan'=>4, 'class'=>'text-center warning']], ['content'=>'Header Before 3', 'options'=>['colspan'=>3, 'class'=>'text-center warning']], ], 'options'=>['class'=>'skip-export'] // remove this row from export ] ], 'toolbar' => [ ['content'=> // Html::button('<i class="glyphicon glyphicon-plus"></i>', ['type'=>'button', 'title'=>Yii::t('', 'Add Book'), 'class'=>'btn btn-success', 'onclick'=>'alert("This will launch the book creation form.\n\nDisabled for this demo!");']) . ' '. // Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['grid-demo'], ['data-pjax'=>0, 'class' => 'btn btn-default', 'title'=>Yii::t('', 'Reset Grid')]) Html::a('Create Karyawan', ['create'], ['class' => 'btn btn-success']) ], '{export}', '{toggleData}' ], 'pjax' => true, 'bordered' => true, 'striped' => false, 'condensed' => false, 'responsive' => true, 'hover' => true, 'floatHeader' => true, 'floatHeaderOptions' => ['top' => $scrollingTop], 'showPageSummary' => true, 'panel' => [ 'type' => GridView::TYPE_PRIMARY ], ]); ?>