-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSerialColumn.php
More file actions
30 lines (23 loc) · 845 Bytes
/
Copy pathSerialColumn.php
File metadata and controls
30 lines (23 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
namespace dacduong\inlinegrid;
use kartik\grid\SerialColumn as KartikSerialColumn;
use yii\helpers\Html;
class SerialColumn extends KartikSerialColumn {
public $cssClass = 'dd-serial';
/**
* @inheritdoc
*/
public function renderDataCell($model, $key, $index)
{
$options = $this->fetchContentOptions($model, $key, $index);
$this->parseExcelFormats($options, $model, $key, $index);
$out = $this->grid->formatter->format($this->renderDataCellContent($model, $key, $index), $this->format);
//add class identity class
if (!array_key_exists('class', $options)) {
$options['class'] = $this->cssClass;
} else {
$options['class'] .= " $this->cssClass";
}
return Html::tag('td', $out, $options);
}
}