Closed Dukobpa3 closed 6 months ago
What is displayed in the field has no effect on how it is sorted if it has accessorFn. Only the value that the accessor returns affects the sorting order. For infinity case the accessor likely returns NaN which javascript sorts however it sorts, if you want to change sorting order you need to take care of 0 download case separately. That said, you can't just remove infinity without replacement and I doubt there is a better one.
So with sorting I think the issue is that All accessorFn's returns <div></div>
For U/D I've just made custom one sorting.
I've removed inifinity just because of cleaner look and code)) Not because of sorting
@qu1ck I've fixed sorting. So if U ok with it – ready to merge
Sorting fix looks good, but keep the infinity.
Done
Wait then
I'l play with it a little
Wanna get proper sorting between inf and zero
I fixed it so infinity is not below zero in sorting and 0 upload always shows "-". Thanks for contributing!
And as result you've made only dashes)) We will never see infinity now. I like it (:
Infinity is still shown when upload is > 0 and download is 0, as was intended. That is the case when you are seeding data that you already had, for example uploading your own torrent.
Sorting still not perfect but I think there is enough time wasted already))
I've just made this PR but then figured out that we don't need the infinity sign at all. We can see not loaded torrents by many others marks like empty bar or status icon
https://github.com/openscopeproject/TrguiNG/pull/135
Maybe not merge it for now because I trying to understand how to provide custom sorting for columns with
accessorFn
. Most of them sorting in some unpredictable wayCould you help with some manuals? I'm not coding ts at all, just raw js a little. My main langs is java/c#.