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

Added unwrap to filter method to make it work with observableArrays #35

Closed
wants to merge 1 commit into from

Conversation

esbenp
Copy link

@esbenp esbenp commented Apr 22, 2015

Added a unwrap to the filter method so it works if an observableArray is passed to the DataTable constructor.

@cmbankester
Copy link
Contributor

Thanks for this PR, but allowing an observableArray to be stored in @rows seems odd, considering @rows is an observableArray itself. I do think we should be using ko.unwrap, though.

@cmckni3
Copy link
Collaborator

cmckni3 commented Jan 28, 2016

I found this to be odd as well.

I think we would use ko.unwrap on the places changing the observableArray's value. For example, calling ko.unwrap on the rows local variable in the replaceRows function.

@cmbankester
Copy link
Contributor

@cmckni3 Exactly. Basically anywhere we're calling a ko observable (e.g. this.rows(), this.sortDir(), etc.), we should instead use ko.unwrap (i.e. ko.unwrap(this.rows), ko.unwrap(this.sortDir) respectively).

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

Successfully merging this pull request may close these issues.

3 participants