inovua / reactdatagrid

Empower Your Data with the best React Data Grid there is
https://reactdatagrid.io
Other
3.45k stars 57 forks source link

🐛 The filter function is not working #393

Open GTLSlb opened 8 months ago

GTLSlb commented 8 months ago

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