Can't get table to regenerate

I am showing the operating screen so you have a visual of what I am trying to do.
There are filter buttons at the top for viewing the Accounts Receivable.

An example of the code under one filter button is shown in the second screen.

The filter button puts the name of the new filter in Local Storage and that shows up fine on screen but the restore code for the new filter does not work.

I have shown the restore code in the 3rd poicture.

Any suggestions?

Mike

PICT3

Mike,
Two things:
RestoreInvoices02b does not utilise the localStorage values....
What does RefreshTable1.trigger() do? Does it use the localStorage 'ARFilter'?

Scott:

The RestoreInvoices02b code does not use local storage. The filter is built into the code i.e. Recdays > 30.

select * FROM Invoices02 where EXTRA1 ="X" and EXTRA2 = "X" and Recdays > 30 group by Invnbr ;

The code under RefreshTable1 is simply :
table1.refresh()

I think I am going to require 4 different screens with each one booting up with its own filter for the table.

Mike

So maybe I am misunderstanding your issue:
You're applying a filter to the table by clicking a button but what does the button do? What query does it run? If it's running the one's you posted about then the table would not change...

You should be able to filter the table using the filterStack

What is the FilterStack?

Mike

Scott:

I have tried 2 versions:
1)

table1.setFilterStack({
  filters: [
    { columnId: "EXTRA1", operator: "=", value: "X" },
    { columnId: "EXTRA2", operator: "=", value: "X" },
    { columnId: "Recdays", operator: ">", value: 30 },
  ],
});
table1.setFilterStack({
  filters: [
    { EXTRA1 = "X" },
    { EXTRA2 = "X" },
    { Recdays > 30 },
  ],
});

All I get is error messages.

Mike

Are you using a legacy table?

Are you running this as a js query?

dataTable.setFilterStack({
  filters: [
    { columnId: "id", operator: "=", value: 1 },
  ],
  operator: "and",
});

works for me

Scott:

The first picture shows the operating screen.

The second picture shows the JS Code under the "over 30 days" button.

As I push on each button the local storage label shows up on the left but the filtering does not change.

I think I will create 4 different screens to do this. I don't think the FilterStack works in my operating environment.

Mike

pict2

Hi @mdsmith1

For the setFilterStack, can you share a screenshot of the table filter properties in the state tab after you run the JS query?

Similar to this screenshot:

Just in case it applies to your table, setting the filter stack will not work for a table that has server side pagination enabled

Tess: How would I be able to check on whether "Server Side Pagination" was enabled?

Mike

Hi Mike,

It would be an "Add-on" for the table:

Tess: I have tried the "Add-On" for the table and it gives me 5 choices but none of them are about "Server Side Pagination".

I am attaching some pictures.

Mike


pict2

Ah okay, this looks like the legacy table so pagination would be here:

If you want to use filtering on the table component, you'd want to make sure this is not checked on.

The filter query + properties should look like this:

Tess: OK I have found the "Server Side Pagination" and it was turned off already (blank).

Anyway, I have this working by regenerating the table with a new filter. This is working fine so I think I will leave it as is. But I have filed your suggestion if it comes up again.

Mike

1 Like

Any chance to get filter stack with server side pagination? Example a client wants the <>= etc operators but cant figure it how to do it with full server side pagination

It's not on our roadmap, @agaitan026 :disappointed: Could you have some JS that checks if the user has selected <,>, etc, and then trigger a query where <, >, etc is hardcoded?

1 Like

Can you show a example? Looks complicated

This example is similar to what I was thinking.

It would be a bit more complex if your user can input other options like >, <, = in addition to >= and <=, but here's an example:

1 Like

Great thank you