ant-design / pro-components

🏆 Use Ant Design like a Pro!
https://pro-components.antdigital.dev
MIT License
4.12k stars 1.32k forks source link

🐛[BUG] - Filter in Column don't seem to work #8466

Open SquirrelCorporation opened 1 month ago

SquirrelCorporation commented 1 month ago

Hi,

Local filtering for ProTable doesn't seem to work, at least partially. I have the following columns def: https://github.com/SquirrelCorporation/SquirrelServersManager/blob/master/client/src/pages/Admin/Inventory/InventoryColumns.tsx For some reason, filtering locally with the field "IP" works, but the others don't. Am I doing something wrong or this is a bug?

Screenshot 2024-06-03 at 14 33 10
SquirrelCorporation commented 1 month ago

Example of column definition:

const columns: ProColumns<API.DeviceItem>[] = [
    {
      title: 'Host ID ',
      dataIndex: 'uuid',
      valueType: 'textarea',
      hideInTable: true,
    },
    {
      title: 'IP',
      dataIndex: 'ip',
      render: (dom, entity) => {
        return (
          <a
            key={entity.uuid}
            onClick={() => {
              setCurrentRow(entity);
              setShowDetail(true);
            }}
          >
            {dom}
          </a>
        );
      },
    },
    {
      title: 'Hostname',
      dataIndex: 'hostname',
      valueType: 'textarea',
    },
    {
      title: 'Status',
      dataIndex: 'status',
      hideInForm: true,
      valueEnum: {
        0: {
          text: 'Registering',
          status: 'Warning',
        },
        1: {
          text: 'Online',
          status: 'Success',
        },
        2: {
          text: 'Down',
          status: 'Error',
        },
        3: {
          text: 'Unmanaged',
          status: 'Processing',
        },
      },
    },
SquirrelCorporation commented 3 weeks ago

Continuing further my investigation and looking at the request part of ProTable, printing the filterargument { filters: true/false, onFilter: true/false} is never printing any values in the object (in this example, uuid is always null in the filter param of the request call).