Limit max selected records on bulk table

Hi, is there a way to limit the maximum records to select ? Because with big table it will definitely leads to problems if a user select to many records.
19 Replies
Jacob
Jacob2mo ago
@lamberttraccard Did you find a way to limit it?
Matthew
Matthew2mo ago
Paginate ?
toeknee
toeknee2mo ago
it's already limited to 50 you can use limit(50)
Jacob
Jacob2mo ago
No, limit the selection of bulk action records. You can now select thousands of records and the browser will crash
toeknee
toeknee2mo ago
Hmm it shouldn't crash. Are you allowing people to display thousands of records?
Jacob
Jacob2mo ago
No, it's paginated. But when you bulk select records an options appears to select ALL THE RECORDS.
No description
toeknee
toeknee2mo ago
It does, but it doesn't at the same time. It's not sending all records over the action. Maybe check your indexes are setup correctly
Jacob
Jacob2mo ago
I want do something with the records, that's why someone selects them. Only a simple update of the selected records hurts the performance badly. Table performance is terrible in V3, hope it's improved in V4
toeknee
toeknee2mo ago
It is improved in V4. But it's also not bad in V3 unless you have lots of bad code.
Matthew
Matthew2mo ago
Remove the select\deselect all. Limit your pagination. That's done. Alternatively, use a proper handler and reject too many records at once with a notification.
Jacob
Jacob2mo ago
That's the question... How...?
toeknee
toeknee2mo ago
So I would say to remove the select all option, and just add a header action so the select all doesn't need to happen...
Jacob
Jacob2mo ago
People want to do things in bulk. They don't want to the same same action a thousand times...
Jacob
Jacob2mo ago
I can only limit the pagination on 100, otherwise Filament will let the browser crash. That's not a sollution for me
Matthew
Matthew2mo ago
Do you wan to view more than 100 records, or bulk update more than 100 records ?
toeknee
toeknee2mo ago
Can you explain the working scenario? What are they trying to do viewing 100+ rows at once You also need to think about the tool you are using and if what you are doing is the right tool for the job. Filament is based on livewire so was never intended to be used for BIG data actions with user interactions. It might be you need to look at a different (vue?) table component for example. V4 has a 2-400% table performance improvement though.
Jacob
Jacob2mo ago
I want to bulk select 40.000 records Can't do that with Filament So I am looking for a way to limit the amount of records someone can select Limit it to for example 1000 records
Matthew
Matthew2mo ago
It's a bit difficult, without knowing the parameters of your project. But all these tools, be it Filament, Vue, React etc, are tools. They aren't magic wands, or catch all solutions. You seem to be suggesting that anything over 100 records is an issue..is that the bulk action , or just the rendering? If it is the rendering, then you're trying to do something too complex, and you need to re-visit your data structure. What is slowing you down is likely to be back end. All frameworks are guilty of treating the database engine like a magic black box, but it's not, and if you are causing all sorts of table scans and complex joins, then it will suffer. Have you profiled the sql queries? I would be looking at how common these bulk updates are. If they are very regular, then maybe a design revisit is needed. If they are occasional, then I might be tempted to build a more custom resource that only pulls back the data needed for update purposes, and I'd also have a handler controlling the update, so I could specify the updated fields, and possibly convert to bulk update queries.

Did you find this page helpful?