Skip to content

Add empty rows when using useGlobalFilter #4044

Answered by PrEaDiVviN
PrEaDiVviN asked this question in Q&A
Discussion options

You must be logged in to vote

I made it work with this. Not great, but it works.

<tbody {...getTableBodyProps()}>
    {
        page.map(row => {
            while(page.length != 10) {
                var currentLine = _.cloneDeep(row);
                currentLine.id += page.length.toString();
                var obj_keys = Object.keys(currentLine.values);
                for(var i=0; i < obj_keys.length; i++) {
                    currentLine.values[obj_keys[i]] = "";
                }
                page.push(currentLine);
            }
            prepareRow(row);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by PrEaDiVviN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant