Power-Components / livewire-powergrid

⚡ PowerGrid generates modern, powerful and easy-to-customize data tables using Laravel Livewire.
https://livewire-powergrid.com
MIT License
1.41k stars 206 forks source link

[FIX] Filtering with Filter::number and methods: thousands() / decimal() not working #1538

Closed dansysanalyst closed 1 month ago

dansysanalyst commented 1 month ago

⚡ PowerGrid - Pull Request

Welcome and thank you for your interest in contributing to our project!. You must use this template to submit a Pull Request or it will not be accepted.


Motivation

Description

This Pull Request fixes using the Filter::number with custom separators configured with ` and->thousands(),->decimal()` methods.

  public function filters(): array
    {
        return [
            Filter::number('price_BRL', 'price')
                ->thousands('.')
                ->decimal(',')
                ->placeholder('lowest', 'highest'),
        ];
    }

The column displays prices formatted as #.###,##, and the filter should follow the same format for a better user experience.

Before

no

After

CleanShot 2024-05-09 at 02 06 02@2x

Related Issue(s)

Documentation

This PR requires Documentation update?