inovua / reactdatagrid

Empower Your Data with the best React Data Grid there is

Home Page:https://reactdatagrid.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› The filter function is not working

GTLSlb opened this issue Β· comments

  • what edition are you using - community
  • version for @inovua/reactdatagrid-community

Relevant code or config

    const onSelectionChange = useCallback(
        ({ selected }) => {
            if (selected === true) {
                const filteredData = filter(tableData, filters, columnsElements);
                if (filteredData.length != tableData.length) {
                    setSelected(filteredData);
                    setSelectedRows(selected);
                } else if (tableData) {
                    setSelected(tableData);
                    setSelectedRows(selected);
                }
            } else {
                setSelected(selected);
                setSelectedRows(selected);
            }
        },
        [filters]
    );

The filter function provided by the library itself, is not working when I dont pass columnsElements it return this error:
Uncaught TypeError: Cannot read properties of undefined (reading 'dateFormat')
And when I add the columns in the filter function it returns no data