Skip to content

Selecting just one row with bulk #603

Closed Answered by emiliosh
emiliosh asked this question in Q&A
Discussion options

You must be logged in to vote

I solved it.

    public bool $multiple=false;

    public array $selectedOne=[];

    public function updating($attribute, $value){
        if($attribute==="selected"){
            if(
                count($this->selected)===1 &&
                !$this->multiple &&
                !empty($value)  &&
                count($value) > 1
            ){
                $this->selectedOne=[$value[1]];
            }
        }
    }

    public function updated($attribute)
    {
        if($attribute==="selected"){
            if(count($this->selected)>=1){
                if(count($this->selected)>1){
                    $this->selected=$this->selectedOne;
                }
                $this…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by emiliosh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant