glittershark/reactable

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

Opened this issue · 0 comments

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.