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

sortFunction given a and b as is, filterFunction is given string #378

Open
yoiang opened this issue Jun 1, 2017 · 0 comments
Open

sortFunction given a and b as is, filterFunction is given string #378

yoiang opened this issue Jun 1, 2017 · 0 comments

Comments

@yoiang
Copy link

yoiang commented Jun 1, 2017

Hey, thanks so much for the work on this project, it's a charm.

I have one question regarding implementation:

If one provides a column a sortFunction that function is sent a and b (left and right) exactly how the values have been given (

if (currentSort.direction === 1) {
return this._sortable[currentSort.column](keyA, keyB);
} else {
return this._sortable[currentSort.column](keyB, keyA);
}
)

On the other hand if one provides a column a filterFunction that function is sent contents a string, always (

if (this._filterable[filterColumn](extractDataFrom(data, filterColumn).toString(), filter)) {
)

Is there a reason for this difference? It would be great to preserve contents' type to match sortFunction, that way you have more of the original information to test your filter function on.

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

No branches or pull requests

1 participant