From b19d30c7ad5a041ccc42ca9542150c7b371fe4fe Mon Sep 17 00:00:00 2001 From: Sam Light Date: Fri, 27 Dec 2024 23:04:40 +0000 Subject: Lots of updates --- src/Columns/Column.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/Columns/Column.php') 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); -- cgit v1.2.3