rappasoft / laravel-livewire-tables

A dynamic table component for Laravel Livewire
https://rappasoft.com/docs/laravel-livewire-tables/v2/introduction
MIT License
1.76k stars 330 forks source link

[Feature Request]: after rows (data) load hook #1458

Closed xabec closed 11 months ago

xabec commented 11 months ago

Overview

Hi, at first, thank you for your hard work on this great package. It would be awesome if it would have some kind of hooks or ways to alter data before loading it. I was trying to override getRows() method but yet the data is manipulated somehow that I can't recreate data format no matter what I try and it's not very convenient either way. It would be awesome if we could adjust some things before data is loaded and after data is loaded. For example change some values, add extra custom row or whatever.

If you have any further questions what do I mean let me know.

Detailed explanation

When I add F.E. into my DataTableComponent

public function afterDataLoadHook($data) {
$data[] = [
'date' => '2023-10-27',
'pick' => '1',
'tries' => '5'
];

return $data;
}

or whatever it would add a new row to existing data before rendering the table.

Notes

No response

lrljoe commented 11 months ago

Please reach out on the Official Discord to discuss this further, as I'm missing the purpose/use-case here!