table expandable rows?

I saw in another post where someone was able to make more of an expandable row (as opposed to collapsible) where the detail data is hidden at first, but the user can expand out to see it. I want to do something similar, but where the row itself has summed values, and when you expand it out, you see the detail of each item making up the sum. I've got the basics kind of but not really working, but the column headers aren't showing up, and I don't know how to make the row data structured the way I want it. The data in my database is at the lowest level of granularity, so I need to sum and display as the row data with the details in the expanded view. Anyone have any idea how I would do this? The screenshot shows basically what I would expect to see in the detail, but is missing the summed values by id (1008 in this example). I basically want to see all this detail when I click on a row, and I want the sum of all this detail displayed as the main row itself. Do I need a custom view?
No description
1 Reply
Jon Mason
Jon MasonOP6mo ago
public function table(Table $table): Table
{
return $table
->query(AgedPayable::query())
->columns([
Split::make([
TextColumn::make('location_id')
->label('Location'),
TextColumn::make('locations.name')
->label('Name'),
TextColumn::make('current')
->label('Current'),
TextColumn::make('1_30_days')
->label('1-30 Days'),
TextColumn::make('31_60_days')
->label('31-60 Days'),
TextColumn::make('61_90_days')
->label('61-90 Days'),
TextColumn::make('91_and_over')
->label('91+ Days'),
TextColumn::make('total')
->label('Total'),
]),
Panel::make([
Split::make([
TextColumn::make('91_and_over'),
TextColumn::make('total'),
]),
])->collapsed(true)
]);
}
public function table(Table $table): Table
{
return $table
->query(AgedPayable::query())
->columns([
Split::make([
TextColumn::make('location_id')
->label('Location'),
TextColumn::make('locations.name')
->label('Name'),
TextColumn::make('current')
->label('Current'),
TextColumn::make('1_30_days')
->label('1-30 Days'),
TextColumn::make('31_60_days')
->label('31-60 Days'),
TextColumn::make('61_90_days')
->label('61-90 Days'),
TextColumn::make('91_and_over')
->label('91+ Days'),
TextColumn::make('total')
->label('Total'),
]),
Panel::make([
Split::make([
TextColumn::make('91_and_over'),
TextColumn::make('total'),
]),
])->collapsed(true)
]);
}
Want results from more Discord servers?
Add your server