#FEAT
+ Added EMPTY flag to be used by column settings
This commit is contained in:
@@ -8,6 +8,7 @@ use Mmt\GenericTable\Attributes\CellFormatter;
|
||||
use Mmt\GenericTable\Attributes\MappedColumn;
|
||||
use Mmt\GenericTable\Components\Column;
|
||||
use Mmt\GenericTable\Components\ColumnCollection;
|
||||
use Mmt\GenericTable\Enums\ColumnSettingFlags;
|
||||
|
||||
trait WithColumnFormatter
|
||||
{
|
||||
@@ -25,9 +26,15 @@ trait WithColumnFormatter
|
||||
new Column('Price'),
|
||||
new Column('Stock'),
|
||||
new Column('SubDepartment', 'subDepartment.name'),
|
||||
new Column('Empty Column')->withSettings(ColumnSettingFlags::EMPTY),
|
||||
new Column('Empty Hook')->withSettings(ColumnSettingFlags::EMPTY)->hookFormatter(fn($rowModel) => $this->emptyCol($rowModel)),
|
||||
);
|
||||
}
|
||||
|
||||
public function emptyCol($model)
|
||||
{
|
||||
return '<i class = "text-danger">'.$model->id.'</i>';
|
||||
}
|
||||
|
||||
#[CellFormatter('price')]
|
||||
public function priceFormatter(Model $modelItem)
|
||||
|
||||
Reference in New Issue
Block a user