diff --git a/src/Components/TableCell.php b/src/Components/TableCell.php index 608c6af..094bdaf 100644 --- a/src/Components/TableCell.php +++ b/src/Components/TableCell.php @@ -26,6 +26,7 @@ class TableCell extends HtmlTag public function __construct(FieldConfig $column) { $this->setColumn($column); + $this->setAttributes($column->getAttributes()); } public function getAttributes() diff --git a/src/FieldConfig.php b/src/FieldConfig.php index 15f4ffa..da52d3c 100644 --- a/src/FieldConfig.php +++ b/src/FieldConfig.php @@ -44,6 +44,11 @@ class FieldConfig /** @var callable */ protected $callback; + /** + * @var array + */ + protected $attributes = []; + protected $is_hidden = false; /** @@ -332,4 +337,22 @@ public function getValue(DataRowInterface $row) return $row->getCellValue($this); } } + + /** + * @param array $attributes + * @return $this + */ + public function setAttributes($attributes) + { + $this->attributes = $attributes; + return $this; + } + + /** + * @return array + */ + public function getAttributes() + { + return $this->attributes; + } }