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

dataSort sorts data provided in data in-place rather than using a copy or some other heuristic #210

Closed
finkelm opened this issue Jan 13, 2016 · 4 comments

Comments

@finkelm
Copy link

finkelm commented Jan 13, 2016

As stated dataSort=true literally sorts the data provided in data. While this can be desirable sometimes, it seems this would break with desired component behaviour wherein daughter components do not tamper implicitly with data being provided by a parent. I would think that data passed into data should stay the same after a sort.

@AllenFang
Copy link
Owner

@finkelm, sorry for my pool english..., did you think I should not change the sorting order on data source? if a good example will be better to undestand :)

@finkelm
Copy link
Author

finkelm commented Jan 21, 2016

For example, I provide a data array with: [{id: 4}, {id: 3}, {id: 2}, {id: 1}, {id: 0}] and provide it as an input to the table component. When I click to sort, the component actually changes the array to [{id: 0}, {id: 1}, {id: 2}, {id: 3}, {id: 4}]. The parent component's version of data has been changed!

@AllenFang
Copy link
Owner

@finkelm, ok I understand. Thanks :)

@AllenFang
Copy link
Owner

@finkelm, fixed it on v1.4.5. check this out

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