Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Filter is lost when the table is re-rendered #215

Open
tsuna opened this issue Nov 29, 2015 · 4 comments
Open

Filter is lost when the table is re-rendered #215

tsuna opened this issue Nov 29, 2015 · 4 comments
Labels

Comments

@tsuna
Copy link

tsuna commented Nov 29, 2015

I have a Reactable.Table that is updated dynamically by updates coming down via a WebSocket socket. When a filter is active on the table, the filter is lost when the table is re-rendered as a result of a state update. Things like column sorting are preserved across updates though.

@zackharley
Copy link

I am also having this issue.

@brandonros
Copy link

Really not an ideal solution, but adding

columns.sort(function (a, b) {
    if (a['label'] < b['label']) {
        return -1;
    }

    else if (a['label'] > b['label']) {
        return 1;
    }

    return 0;
});

to src/reactable/table.jsx right before the return in render fixes it, sort of.

@theopolisme
Copy link

Bump - status of this issue?

@kdmitrijs
Copy link

Would be great to see a fix for this. Being forced to do something silly like retrieving the current filter from onFilter and reapplying it with filterBy on every render.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants