Code Monkey home page Code Monkey logo

Comments (3)

mokhosh avatar mokhosh commented on June 6, 2024

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.

PLGUPICTO avatar PLGUPICTO commented on June 6, 2024

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.

mokhosh avatar mokhosh commented on June 6, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.