Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to reset the table when prop changes? As in when the new data come in, i want the currPage to go back to 1 and remove the sorted table and so on. #975

Closed
kadariyp opened this issue Jan 19, 2017 · 11 comments

Comments

@kadariyp
Copy link

No description provided.

@AllenFang
Copy link
Owner

@kadariyp, I thought there are something I am supposed to improve

@mjmhall
Copy link

mjmhall commented Jan 23, 2017

I reset the table in componentDidUpdate by using the table handlers

componentDidUpdate() {
if (this.props.forceTableSort) {
/*
force the table data to the first page, clear any searches
and make sure the 1st page of the table is displayed
*/
this.table.handlePaginationData(1, 10);
this.table.handleSearch('');
this.table.handleSort('desc', 'rowId');
}
}

@AllenFang
Copy link
Owner

yap, these exposed function is a workaround, but just no very react style~

@kadariyp
Copy link
Author

kadariyp commented Feb 2, 2017

Any update on this feature?

@AllenFang
Copy link
Owner

@kadariyp, sorry for lately fixing, it still work in process, I only few hours a day and need to handle all the issue here, and I've tag this issue as inprocess which means I'll handle it or I'm handling, so just be patient :)

BTW, I thought there's some bugs in componentWillReceiveProps so it really be handled more carefully.

@AllenFang
Copy link
Owner

Just a question, @kadariyp, did you use the remote mode?

@AllenFang
Copy link
Owner

@kadariyp, try this.refs.table.reset() when you table ready to update, upgrade to v2.11.1, let me know if you got any trouble

@kadariyp
Copy link
Author

kadariyp commented Feb 6, 2017

Thanks @AllenFang. I tried to update the version to this one but it throws an npm error. react toastr issue. any idea on when this issue will be resolved?

@AllenFang
Copy link
Owner

what's version you used before and is that same with #838 or #898 or #863?

@kadariyp
Copy link
Author

Its same as 863. Trying to install new version but react-toastr throws the error.

@AllenFang
Copy link
Owner

sorry about this issue, because it happen some time and I can't reproduce it and if somebody can give me all the environment setting, dependencies version and a minimal and simple repo will be better.

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

No branches or pull requests

3 participants