Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The select filter does not change when the nova select filter changes #97

Open
bocanhcam opened this issue Apr 23, 2024 · 4 comments
Open

Comments

@bocanhcam
Copy link
Contributor

I have a select filter like the one below.

The problem is when I change the select option in the original filter of Nova then the select option in MegaFilter does not change.

If it's the opposite, no problem.

class OrderPaymentStatusFilter extends Filter
{
    /**
     * The filter's component.
     *
     * @var string
     */
    public $component = 'select-filter';
    public $name = "入金";

    public function apply(NovaRequest $request, $query, $value)
    {
        $value = array_search($value, PaymentStatus::get());
        return $query->where('payment_status', $value);
    }
}
public function filters(NovaRequest $request): array
    {
        return [
            MegaFilter::make([
                //..another filer,
                OrderPaymentStatusFilter::make(),
            ])
        ];
    }
@milewski
Copy link
Member

Hi they shouldn't change.. they are not in sync, why do you have 2 select filters on the same page?

@bocanhcam
Copy link
Contributor Author

Hi @milewski .
If the filter is inside the MegaFilter then I expected they are synced.
And I don't see that Nova has an option that allows us to hide the default filter.

@milewski
Copy link
Member

So you mean that when you use the filter on the megafilter the same filter is also showing on the nova filter? ...

@bocanhcam
Copy link
Contributor Author

Yes. It is.
Screenshot from 2024-04-23 13-16-25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants