Comments (3)
Technically you can do this, but it would be very weird, because as you move cards between your columns, things will appear and disappear out of nowhere.
You could do something like this maybe:
protected function records(): Collection
{
$tasks = collect();
foreach (ClientSubstatus::cases() as $status) {
$tasks->push(...Task::where('status', $status)->take(10)->get());
}
return $tasks;
}
Or maybe you can come up with one query that limits per status on a database level, but this has the UX issue that I mentioned.
The more sensible thing would be to limit the total number of tasks instead of per status.
from filament-kanban.
I have found temporary solution by making the cards limit. But I made it in the blade side. This one limit the panel to 10. The 10 is just static for now, plan to make it dynamic where user can select limit.
<div class="md:w-[24rem] flex-shrink-1 min-h-full flex flex-col">
@include(static::$headerView)
<div
id="{{ $status['id'] }}"
class="flex flex-col flex-1 gap-2 p-3 bg-gray-200 dark:bg-gray-800 rounded-xl"
>
@foreach($status['records'] as $record)
@php
$limit++
@endphp
@if($limit <= 10)
@include(static::$recordView)
@endif
@endforeach
</div>
</div>
It's not the best solution, I will just find a way to make it more dynamic. Cool plugin by the way. Thank you!!!
from filament-kanban.
Yup, it still has the bad UX issue.
You can use the code I provided above, and add protected int $countPerBoard = 10
to your board and use that in take
. It's cleaner than loading everything and then limiting in the view.
from filament-kanban.
Related Issues (16)
- How to use Slug HOT 5
- [Question]: I am Unable to Sort if it is Done & How to Add Filter Form in Header HOT 3
- [Bug]: 2 last status can't be moved HOT 5
- [Bug]: Record Not showing
- [Bug]: Kanban view crashes when using Model::preventAccessingMissingAttributes() HOT 4
- [Bug]: Status as integer (correction) HOT 5
- [Bug]: Manage team relationship members HOT 4
- [Request]: Mountable Record Action for record HOT 4
- [Bug]: Laravel 11 support
- [Bug]: Card Break when drag to other status HOT 4
- [Bug]: Error when we use UUID/ULID HOT 3
- [Bug]: Cant use on fresh laravel 11 HOT 2
- [Bug]: Stylesheet can't be loaded with a content security policy HOT 1
- How do I actually use this? HOT 9
- How to customize icon for view HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filament-kanban.