MedicOneSystems / MedicOneSystems/livewire-datatables

how to filter value in array in columns? in method getAtrProperty

Open
#440 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.2k
Forks
257
PR merge metrics
No merged PRs in 30d

Description

how to filter "blue" and "red" and "pink" in columns? in filterable

please see the code below :

        , Column::callback(['color'],function ($color){
            if ($color == 1){
                return "blue";
            }elseif($color == 2){
                return "red";
            }else{
                    return "pink"; 
                }
        })
            ->label('Status')
            ->filterable(['blue','red','pink'])

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue mentions Column::callback, filterable, and getAtrProperty; start by tracing how callback values are handled during filtering. Confirm the expected behavior for blue, red, and pink, then verify that selecting each value returns the matching rows.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
full-stack
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.