deferLoading Placeholder Text

Is it possible to have a default row much like with emptyStateHeading but for when the table is loading. I have a few seconds whereby the table is just empty.
15 Replies
DrByte
DrByte12mo ago
It happens so rarely for me that I can never remember where I've seen it show up ... but isn't the default loading-indicator already loading? https://filamentphp.com/docs/3.x/support/blade-components/loading-indicator
DrByte
DrByte12mo ago
Sure, it's not the same as a placeholder row saying "please wait, we're still finding the records..."
David | Fortune Validator
hmmm no its not showing up. Its just an empty space. I dont know if it makes a diffence but I am only using the table plugin not panels. Im new to Filament today so tryin to find my feet
DrByte
DrByte12mo ago
Actually the first question I had was "why is the table taking so long to load?" ... which is usually because pagination is disabled or set to too high a number.
David | Fortune Validator
oh sorry. it pulls data from an API which takes a few moments to load I used sushi to conver the API source into an eloquent model I guess I could use older livewire lazy loading and have its default loading animation until the table itself is ready to be viewed. I was just hoping to utilise the deferLoading attrivute on the table itself
DrByte
DrByte12mo ago
Perhaps. I'd be inclined to treat this as a nice-to-have-eventually, not as a blocker that needs a lot of time spent on it when there are probably other things you're wanting to build into your app. Hopefully someone who has had to solve this too will chime in here once they see this post.
David | Fortune Validator
Thank you @DrByte I'll continue as you say. Lots to learn with filament it seems !
DrByte
DrByte12mo ago
Is there a way to put some visual indicator into the table while waiting for it to load?
awcodes
awcodes12mo ago
I think that was removed because it caused really bad performance with alpine’s dom diff.
David | Fortune Validator
okay no problem. Thank you for confirming. Whilst I have you and sorry for the newbie questions ( first day ). Is it possible for a table row to have a custom css class based on a condition, eg, active = true, then background green?
David | Fortune Validator
legend, thank you. Half my battle so far is finding the info in the docs for what I require haha. nice work on this though
awcodes
awcodes12mo ago
I would recommend actually reading through the docs at least once. It’ll help familiarize yourself with the concepts. Once the concepts click it’s easier to find things in the docs. 🙂
David | Fortune Validator
already on it 🙂 thank you. regaarding this: These classes are not automatically compiled by Tailwind CSS. If you want to apply Tailwind CSS classes that are not already used in Blade files, you should update your content configuration in tailwind.config.js to also scan for classes inside your directory: './app/Filament/*/.php' my tailwind.config does contain the dir specified but it wont find the new tailwind classes I can see the class is added to the <tr> but no styling applied -- Ignore me - I needed to add Livewire directory not Filament as Im added to an exising project
Want results from more Discord servers?
Add your server