Opened 14 years ago
Closed 14 years ago
#2378 closed defect (wontfix)
FilteringTable: sorts even when not requested to
Reported by: | Owned by: | Tom Trenka | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Widgets | Version: | 0.4.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
FilteringTable?.createSorter() returns a compare function even if there is no information on how to sort (sortFunctions array contains 0 elements). It then sorts the rows using this compare function, which returns always 0. Depending on the browser (its internal sorting algorithm) the rows are left alone (IE), or shuffled (Firefox). Per intuition I would suppose FilteringTable? to show the rows in natural order in this case. So I added 3 lines to FilteringTable?.createSorter() (above the final "return" statement):
if (sortFunctions.length == 0) {
return;
}
The only caller within FilteringTable? is render(), which already does the right thing if createSorter() returns undefined.
Attachments (2)
Change History (5)
Changed 14 years ago by
Attachment: | wrongsort.patch added |
---|
Changed 14 years ago by
Attachment: | wrongsort.2.patch added |
---|
corrected patch - I'm sorry, the first one was nonsense
comment:1 Changed 14 years ago by
I'd like to also see a generic enableSort="true/false" option that's examined inside render(), and when false, skips sorting altogether...
This would avoid having to do noSort="true" on all columns (or manually blanking with FT.sortOptions=[]).
More importantly (imo), it also allows optimization of the initial table rendering. When the initial sort is implicit (say the data comes from a SQL ORDER BY clause), avoiding the redundant sort can save several seconds in initial rendering time.
comment:2 Changed 14 years ago by
Owner: | changed from bill to Tom Trenka |
---|
comment:3 Changed 14 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Sorting in new Table widget will be done by dojo.data so we aren't going to fix the sorting builtin to FilteringTable?.
suggested patch to be applied to current head of FilteringTable?.js