Ejemplo n.º 1
0
<?php 
yii\widgets\Pjax::begin(['id' => 'grid-kpiresult-pjax', 'timeout' => 5000]);
?>

<?php 
//echo $this->render('_search', ['model' => $searchModel]);
?>
<br>
<div class="box box-success">
  <div class="box-header with-border">
    <h3 class="box-title">จัดอันดับคะแนนระดับอำเภอ</h3>
    <div class="box-tools pull-right">
      <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
      <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
    </div><!-- /.box-tools -->
  </div><!-- /.box-header -->
  <div class="box-body">
    <?php 
echo GridView::widget(['id' => 'grid-kpiresult', 'dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-bordered  table-striped table-hover'], 'panel' => ['type' => GridView::TYPE_PRIMARY, 'heading' => false], 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], 'amp', 'amphur.Amp_Des', 'avg_score' => ['attribute' => 'คะแนนเฉลี่ย', 'format' => ['decimal', 2], 'value' => 'avgScore']]]);
yii\widgets\Pjax::end();
?>

<!-- <div class="overlay">
  <i class="fa fa-refresh fa-spin"></i>
</div> -->
  </div><!-- /.box-body -->
</div><!-- /.box -->


Ejemplo n.º 2
0
    'tableOptions'=>['class'=>'table table-striped table-hover table-normal'],
    'pager' => [
        'firstPageLabel' => 'First',
        'lastPageLabel' => 'Last',
    ],
    'columns' => [
        'client',
        'name',
        'id',

        [
            'attribute' => 'streetAddress',
            'format' => 'html',
            'value' => function($data) {
                return $data->streetAddress.'<br />'.$data->city.' '.$data->state.' '.$data->zipcode;
            },
            'label'=>'Property Address',
        ],
        [
            'attribute' => 'latitude',
            'format' => 'html',
            'value' => function($data) {
                return $data->latitude.'<br />'.$data->longitude;
            },
            'label'=>'Location',
        ],
        ],
]); ?>

<?php yii\widgets\Pjax::end() ?>
</div>