javascript 带数字的反表过滤器

kmbjn2e3  于 2022-12-21  发布在  Java
关注(0)|答案(1)|浏览(150)

我想使用带有一组数值的筛选器来筛选表格,例如查找带有0或Null

的帐户
这对我没用

filters: [
        { text: "zero", value: 0 },
        { text: "null", value: "null" }
      ],

'

axr492tv

axr492tv1#

需要插入onFilter函数,示例:

const columns = [
    {
      title: "Name",
      dataIndex: "name",
      key: "name"
    },
    {
      title: "Age",
      dataIndex: "age",
      key: "age",
      onFilter: (value, record) => record.age === value,
      filters: [
        {
          text: "null",
          value: null
        },
        {
          text: "0",
          value: 0
        }
      ],
      filterSearch: true,
      sortDirections: ["descend"]
    }
  ];

codsandboxexample

相关问题