dead-brownD
Refine2y ago
13 replies
dead-brown

Filter a table field with outside component and state

Hi guys, I'm using useTable to get data from database, here is my useTable code
const filter = superfoodsFilter
    ? [
        {
          field: "superfoods",
          operator: "eq",
          value: superfoodsFilter,
        },
      ]
    : [];
  const { tableProps: manuTableProps } = useTable({
    syncWithLocation: true,
    resource: "proposaled_components",
    filters: {
      initial: filter,
      permanent: [
        {
          field: "plan_id",
          operator: "eq",
          value: id,
        },
      ],
    },
  });

Curently, I have a selection to change superfoodsFilter value, I want to filter my superfoods field in a table with the dropdown, how can I do that ?
Was this page helpful?