Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#9260 closed defect (fixed)

ClientFilter: Sorting Comparator Fails when Items are Equal in IE

Reported by: Jarrod Carlson Owned by: Kris Zyp
Priority: high Milestone: 1.4
Component: DojoX Data Version: 1.3.0
Keywords: data clientfilter ie Cc:
Blocked By: Blocking:

Description

While using a JsonRestStore? with the ClientFilter? mixin, I received a result set from the server which was to be used with a FilteringSelect? widget.

The FilteringSelect? widget specified that the results be sorted by the 'name' attribute on the item. The result set contains two items with the same the name.

When the ClientFilter? attempted to sort on the 'name' attribute, the comparator failed to handle lexicographically identical items.

The problematic code is in ClientFilter::makeComparator (see source:/dojox/trunk/data/ClientFilter.js#L249)

To demonstrate this failure, attached is a code snippet. The code has been extracted directly from ClientFilter? in order to eliminate variables, but is programatically identical to the problem in ClientFilter::makeComparator.

In the sample, when sorting using the 'brokenSort' sorter, an exception is thrown by the native array sort function. When using the 'workingSort' sorter instead, the sort function works as expected.

It should be noted that this problem only affects IE6 and IE7 (maybe IE8?). The problem does not affect Firefox 3 or Safari 3.

While I understand that my code can simply pass an additional sorting qualifier to the ClientFilter? (as I have done with 'workingSort') to avoid this problem, this defect is not about workarounds. This defect is purely about the fact that the ClientFilter?'s sorting mechanism does not handle equivalent items.

Attachments (1)

sort.html (2.1 KB) - added by Jarrod Carlson 11 years ago.
Broken Comparator Example

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by Jarrod Carlson

Attachment: sort.html added

Broken Comparator Example

comment:1 Changed 11 years ago by Jarrod Carlson

Mayhaps sprinkling in a little source:/dojo/trunk/data/util/sorter.js goodness is in order?

comment:2 Changed 11 years ago by Jared Jurkiewicz

Owner: changed from Jared Jurkiewicz to Kris Zyp

comment:3 Changed 11 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

(In [17532]) fixes #9260

comment:4 Changed 11 years ago by Kris Zyp

Milestone: tbd1.4
Note: See TracTickets for help on using tickets.