summaryrefslogtreecommitdiff
path: root/src/Columns/Column.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Columns/Column.php')
-rw-r--r--src/Columns/Column.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/Columns/Column.php b/src/Columns/Column.php
index f3fe811..94e386f 100644
--- a/src/Columns/Column.php
+++ b/src/Columns/Column.php
@@ -19,9 +19,11 @@ class Column {
private ?Closure $sortFn = null;
private ?Closure $tdAttributesFn = null;
+ private ?string $colClass = null;
+
public function __construct(
public string $name,
- public ?string $title = null
+ private ?string $title = null
) {
$this->showInSelect = $this->title !== null;
}
@@ -36,6 +38,11 @@ class Column {
$this->table = $table;
}
+ public function getTitle()
+ {
+ return $this->title;
+ }
+
private function defaultSlot(Model $row)
{
return $row->{$this->name};
@@ -53,6 +60,17 @@ class Column {
return $this;
}
+ public function colClass(string $v) : static
+ {
+ $this->colClass = $v;
+ return $this;
+ }
+
+ public function getColClass() : ?string
+ {
+ return $this->colClass;
+ }
+
public function tdAttributes(callable $fn) : static
{
$this->tdAttributesFn = Closure::fromCallable($fn);