Added No column for all resource tables page
This commit is contained in:
@@ -54,10 +54,14 @@ class DeviceMasterResource extends Resource
|
|||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
Tables\Columns\TextColumn::make('id')
|
Tables\Columns\TextColumn::make('No.')
|
||||||
->label('ID')
|
->label('No.')
|
||||||
->numeric()
|
->getStateUsing(function ($record, $livewire, $column, $rowLoop) {
|
||||||
->sortable(),
|
$paginator = $livewire->getTableRecords();
|
||||||
|
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
|
||||||
|
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
|
||||||
|
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
||||||
|
}),
|
||||||
Tables\Columns\TextColumn::make('plant.name')
|
Tables\Columns\TextColumn::make('plant.name')
|
||||||
->label('Plant')
|
->label('Plant')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
|
|||||||
@@ -66,10 +66,14 @@ class MfmMeterResource extends Resource
|
|||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
Tables\Columns\TextColumn::make('id')
|
Tables\Columns\TextColumn::make('No.')
|
||||||
->label('ID')
|
->label('No.')
|
||||||
->numeric()
|
->getStateUsing(function ($record, $livewire, $column, $rowLoop) {
|
||||||
->sortable(),
|
$paginator = $livewire->getTableRecords();
|
||||||
|
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
|
||||||
|
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
|
||||||
|
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
||||||
|
}),
|
||||||
Tables\Columns\TextColumn::make('plant.name')
|
Tables\Columns\TextColumn::make('plant.name')
|
||||||
->label('Plant')
|
->label('Plant')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|||||||
@@ -73,10 +73,14 @@ class MfmParameterResource extends Resource
|
|||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
Tables\Columns\TextColumn::make('id')
|
Tables\Columns\TextColumn::make('No.')
|
||||||
->label('ID')
|
->label('No.')
|
||||||
->numeric()
|
->getStateUsing(function ($record, $livewire, $column, $rowLoop) {
|
||||||
->sortable(),
|
$paginator = $livewire->getTableRecords();
|
||||||
|
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
|
||||||
|
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
|
||||||
|
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
||||||
|
}),
|
||||||
Tables\Columns\TextColumn::make('plant.name')
|
Tables\Columns\TextColumn::make('plant.name')
|
||||||
->label('Plant')
|
->label('Plant')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
|
|||||||
@@ -60,11 +60,14 @@ class MfmReadingResource extends Resource
|
|||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
Tables\Columns\TextColumn::make('id')
|
Tables\Columns\TextColumn::make('No.')
|
||||||
->label('ID')
|
->label('No.')
|
||||||
->alignCenter()
|
->getStateUsing(function ($record, $livewire, $column, $rowLoop) {
|
||||||
->numeric()
|
$paginator = $livewire->getTableRecords();
|
||||||
->sortable(),
|
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
|
||||||
|
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
|
||||||
|
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
||||||
|
}),
|
||||||
Tables\Columns\TextColumn::make('plant.name')
|
Tables\Columns\TextColumn::make('plant.name')
|
||||||
->label('Plant')
|
->label('Plant')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
|
|||||||
@@ -62,10 +62,14 @@ class TempLiveReadingResource extends Resource
|
|||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
Tables\Columns\TextColumn::make('id')
|
Tables\Columns\TextColumn::make('No.')
|
||||||
->label('ID')
|
->label('No.')
|
||||||
->numeric()
|
->getStateUsing(function ($record, $livewire, $column, $rowLoop) {
|
||||||
->sortable(),
|
$paginator = $livewire->getTableRecords();
|
||||||
|
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
|
||||||
|
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
|
||||||
|
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
||||||
|
}),
|
||||||
Tables\Columns\TextColumn::make('plant.name')
|
Tables\Columns\TextColumn::make('plant.name')
|
||||||
->numeric()
|
->numeric()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|||||||
Reference in New Issue
Block a user