Open salman-bft opened 12 months ago
What are you trying to archive?
To have your table-header called "serial number" or you try to get the sql column "serial number" both could be achived. Or you could hide the "id" column and show the "serial number" as the first column.
i want to hide the "id" column and show the "serial number" as the first column.
You could use something like this:
class Table extends LivewireDatatable
{
public $hideable = 'select';
public $sort = "serial_number|asc";
public $model = Model::class;
public function builder()
{
return Model::query();
}
public function columns()
{
return [
NumberColumn::name('id')
->hide(),
Column::name('serial_number'),
];
}
}
You can define the order and what will be visible in the tables. The ID Column could also be removed and the table is still working.
how to show row number as a column serial number in livewire datatable
Column::name('id')->label('Id')->truncate(40),
i want to show serial number instead of id