Open SimonVuong opened 8 years ago
the error is because rowsPerPage = Infinity. cannot use infinity if you intend to sort by fn because sort logic is...
sortedRows = sortWithFunctions(rows, this.fields, this.multiColumnSort);
return sortedRows.slice(skip, skip + limit);
and skip + limit = NaN since limit = infinity
Hmm, I think something + Infinity is still Infinity, so I don't think that's the problem.
but can you slice with infinity? I get an empty array if I pass infinity as my second argument.
The problem is skip ends up being NaN - it's currentPage (0) * rowsPerPage (Infinity)
Exactly. I replaced infinity with Number. MAX_SAFE_INTEGER and it works like a charm
i cannot for the life of me figure why it's breaking when i try to sort by fn. the collection is defined in common code. i am using autopublish and insecure packages. the collection stores multiple fields and i am only trying to get 1 field to display in my table currently.
Client side: