ED
ED
FFilament
Created by ED on 9/21/2023 in #❓┊help
Multiple tables on same page
Thank you @cheesegrits
20 replies
FFilament
Created by ED on 9/21/2023 in #❓┊help
Multiple tables on same page
So instead of using the same Sushi model for each table (created separate one) did solve the problem.
20 replies
FFilament
Created by ED on 9/21/2023 in #❓┊help
Multiple tables on same page
Yup, confirming that without sushi it works.
20 replies
FFilament
Created by ED on 9/21/2023 in #❓┊help
Multiple tables on same page
class SushiModel extends Model
{
use \Sushi\Sushi;

private static array $rows;

public static function setRows(array $rows): self
{
self::$rows = collect($rows)->map(function (array $row) {
return collect($row)->map(fn (mixed $value) => is_array($value) ? json_encode($value) : $value);
})->toArray();

return new self;
}

protected function sushiShouldCache(): bool
{
return false;
}

public function getRows(): array
{
return self::$rows;
}
}
class SushiModel extends Model
{
use \Sushi\Sushi;

private static array $rows;

public static function setRows(array $rows): self
{
self::$rows = collect($rows)->map(function (array $row) {
return collect($row)->map(fn (mixed $value) => is_array($value) ? json_encode($value) : $value);
})->toArray();

return new self;
}

protected function sushiShouldCache(): bool
{
return false;
}

public function getRows(): array
{
return self::$rows;
}
}
20 replies
FFilament
Created by ED on 9/21/2023 in #❓┊help
Multiple tables on same page
If I leave only one table component on the page it works as expected. Sushi has cache disabled.
20 replies
FFilament
Created by ED on 9/21/2023 in #❓┊help
Multiple tables on same page
20 replies
FFilament
Created by nuumaan on 9/21/2023 in #❓┊help
How can I pass a custom value for a TextColumn
or format the state => TextColumn::make('amount')->formatStateUsing(fn(Model $record) => $record->custom_amount)
8 replies
FFilament
Created by ED on 9/21/2023 in #❓┊help
Multiple tables on same page
these tables lives on a fullpage Livewire component. At the beginning I thought it was because of the defferLoading() enabled but that seems doesn't effect my issue. Also tried adding key="table1".
20 replies
FFilament
Created by ED on 9/21/2023 in #❓┊help
Multiple tables on same page
I assume there is some sort Alpine/Livewire event that loads table data in to these tables and this might be the issue in my case since bouth of my tables get's triggered on page load...
20 replies
FFilament
Created by ED on 9/21/2023 in #❓┊help
Multiple tables on same page
No description
20 replies
FFilament
Created by ED on 9/21/2023 in #❓┊help
Multiple tables on same page
lets say table1 has 20 records and table2 has 680 records, when the page loads table1 shows 680 records with blank values becouse columns are different in each table, but after I start paginating table1 with empty records it loads correct 30 records in to it...
20 replies
FFilament
Created by ED on 9/21/2023 in #❓┊help
Multiple tables on same page
Unfortunately this is not it.
20 replies
FFilament
Created by ED on 9/21/2023 in #❓┊help
Multiple tables on same page
Also same issue with extending TableWidget vs TableComponent
20 replies