#4491 closed defect (fixed)
Datastore items sort incorrectly on attributes with null values
Reported by: | gizmojo.org | Owned by: | Jared Jurkiewicz |
---|---|---|---|
Priority: | high | Milestone: | 1.0 |
Component: | Data | Version: | 0.9 |
Keywords: | datastore sort null undefined | Cc: | |
Blocked By: | Blocking: |
Description
Datastore items sort incorrectly on a attribute/column for which some items have the attribute set to null.
The datastore ReadAPI doc for the "sort" parameter states:
when comparing attributes, if an item contains no value for the attribute (undefined), then it the default ascending sort logic should push it to the bottom of the list. In the descending order case, it such items should appear at the top of the list.
One would expect this same behaviour for attributes that are set to the javascript null (that is generally more or less used in equivalent way to javascript undefined).
To reproduce [working with revision 10544] take the test file at: dojox/data/demos/demo_DataDemoTable.html and modify the countries.json file that is loaded into the first datastore, by adding a:
population:null
attribute to a bunch of country items that do not have it. Then reload, and try sorting on the population column.
Change History (6)
comment:1 Changed 14 years ago by
Component: | General → Data |
---|---|
Owner: | changed from anonymous to Jared Jurkiewicz |
comment:2 Changed 14 years ago by
Cc: | [email protected]… removed |
---|
comment:3 Changed 14 years ago by
Reporter: | changed from guest to gizmojo.org |
---|
comment:4 Changed 14 years ago by
comment:5 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Actually, null is an object. It's not 'undefined'. Has an actual different meaning. Fixing should be easy, though, to make it act similar.