Table filter - how to preset a filter

UI Components for Angular
Post Reply
Syrrius78
Posts: 5
Joined: 10 Jun 2021, 18:31

20 Sep 2022, 14:47

Hello all,

I totally like the example "Filter Row" in https://www.primefaces.org/primeng/table/filter.

But I have a question :
How could I preset, for example, the "Verified" checkbox to have directly the non-verified data ?
(try playing with stackblitz to do that but it doesn't work what I try)

thanks in advance for your help.

Syrrius78
Posts: 5
Joined: 10 Jun 2021, 18:31

21 Sep 2022, 16:10

I may have found how to do that.
Don't know if it's the best solution but it seems to work.
(doing the sort when we receive the data)

Code: Select all

    this.customerService.getCustomersLarge().then(customers => {
      this.customers = customers;
      this.loading = false;

      this.customers.forEach(
        customer => (customer.date = new Date(customer.date))
      );

      this.dt2.filter(true, 'verified', 'equals');  // how to do the job (preset)
    });

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests