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

使用redux里的数据做数据源时不会跟随数据的改变而重新绘制 #6

Open
zuzuviewer opened this issue Mar 4, 2017 · 2 comments

Comments

@zuzuviewer
Copy link

zuzuviewer commented Mar 4, 2017

在项目中用到了redux。结果发现数据变了,但是cell没有跟随数据变化,一直是第一次绘制出来的,后来在您的源代码中修改了代码就可以了,代码如下:
componentWillReceiveProps (nextProps) { let sortable = nextProps.sortable if (sortable !== this.props.sortable) { this.setState({ sortable, }) } const dataSource = nextProps.dataSource; if(dataSource && (dataSource !== this.props.dataSource)){ this.setState({dataSource:dataSource}); } }
此问题困扰了我两天,麻烦还请您看看有什么问题,我是这样修改后就可以正确显示了。如果没有问题您可以修改下

@cyqresig
Copy link
Contributor

cyqresig commented Mar 5, 2017

您好,感谢您提出的问题,会尽快予以修正

@zuzuviewer
Copy link
Author

又发现一个类似问题就是containerHeight属性也需要随着变化,否则行数增加了也只能显示出第一行

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

No branches or pull requests

2 participants