display count matching getTableRecordClassesUsing
I have a component displaying a table and it's highlighting certain rows using the getTableRecordClassesUsing() function.
The blade file is pretty simple as it just returns the table. However, I'd like to have the count of rows matching the getTableRecordClassesUsing() available in this blade file as I'd like to do some other blade logic based on that value. I tried saving the count in a variable, but it doesn't get updated below the table after the user edits a record making it no longer match the getTableRecordClassesUsing() function. Any help would be greatly appreciated.
Solution:Jump to solution
I have a component displaying a table and it's highlighting certain rows using the getTableRecordClassesUsing() function.
The blade file is pretty simple as it just returns the table. However, I'd like to have the count of rows matching the getTableRecordClassesUsing() available in this blade file as I'd like to do some other blade logic based on that value. I tried saving the count in a variable, but it doesn't get updated below the table after the user edits a record making it no longer match the getTableRecordClassesUsing() function. Any help would be greatly appreciated.
```php...
2 Replies
Can you share your getTableRecordClassesUsing() method, to have a better idea of what's happening?
Here's the solution. In this scenario, it looks for the value from the assessment column for that record and if its value is null, highlight the row with as priority (dark:border.etc if dark mode). If it's not null style it based on the value in the mission column. I then have different styles for each mission value that could exist.