Refactor table components to use GenericTableSettings and remove deprecated classes
This commit is contained in:
@@ -2,22 +2,23 @@
|
||||
|
||||
namespace App\Tables;
|
||||
|
||||
use App\Tables\Traits\WithColumnFormatter;
|
||||
use App\Models\Product;
|
||||
use Mmt\GenericTable\Attributes\MappedRoute;
|
||||
use Mmt\GenericTable\Components\Column;
|
||||
use Mmt\GenericTable\Components\ColumnCollection;
|
||||
use Mmt\GenericTable\Interfaces\IDragDropReordering;
|
||||
use Mmt\GenericTable\Interfaces\IGenericTable;
|
||||
use Mmt\GenericTable\Support\GenericTableSettings;
|
||||
|
||||
class TableWithBindedRoutes implements IGenericTable, IDragDropReordering
|
||||
{
|
||||
use WithColumnFormatter;
|
||||
public GenericTableSettings $tableSettings;
|
||||
|
||||
public string $orderingColumn;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->columns = ColumnCollection::make(
|
||||
$columns = ColumnCollection::make(
|
||||
new Column('Id'),
|
||||
new Column('Name'),
|
||||
new Column('Description')
|
||||
@@ -26,5 +27,9 @@ class TableWithBindedRoutes implements IGenericTable, IDragDropReordering
|
||||
new Column('Stock'),
|
||||
new Column('SubDepartment', 'subDepartment.name'),
|
||||
);
|
||||
|
||||
$this->tableSettings = new GenericTableSettings(
|
||||
Product::class, $columns
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user