#FEAT
+ Added EMPTY flag to be used by column settings
This commit is contained in:
@@ -7,8 +7,6 @@ use Livewire\Component;
|
||||
|
||||
class FrameComponent extends Component
|
||||
{
|
||||
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.examples.frame-component')
|
||||
|
||||
@@ -17,7 +17,7 @@ class TableWithActionColumn implements IGenericTable, IActionColumn, IEvent
|
||||
|
||||
public Model|string $model = Product::class;
|
||||
|
||||
public int $actionColumnIndex = -1;
|
||||
public int $actionColumnIndex = 0;
|
||||
|
||||
public function actionView(Model $item): \Illuminate\View\View
|
||||
{
|
||||
|
||||
@@ -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