Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#5488 closed defect (fixed)

[patch]value of 0 becomes "" with DojoData model

Reported by: haysmark Owned by: sorvell
Priority: high Milestone:
Component: DojoX Grid Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by haysmark)

I'm working with this sitepen demo: http://blog.sitepen.com/examples/dojo_grid_2/grid_objects.html

I noticed that when I converted the grid model to DojoData?, the demo's format functions started receiving "" whenever they were previously receiving 0. I debugged it to this code in the DojoData? model:

processRows: function(items, store){
...
			dojo.forEach(this.fields.values, function(a){
				row[a.name] = this.store.getValue(item, a.name)||"";
			}, this);

Whenever the store returns 0 from the data,

this.store.getValue(item, a.name)||""

returns "", which is wrong and not what the other models do.

Attachments (1)

5488.patch (602 bytes) - added by haysmark 11 years ago.
Fixes #5488. Fixed Grid's DojoData? model to preserve values of 0 and false.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 11 years ago by haysmark

Description: modified (diff)

Changed 11 years ago by haysmark

Attachment: 5488.patch added

Fixes #5488. Fixed Grid's DojoData? model to preserve values of 0 and false.

comment:2 Changed 11 years ago by Adam Peller

Priority: normalhigh
severity: normalmajor
Summary: value of 0 becomes "" with DojoData model[patch]value of 0 becomes "" with DojoData model

comment:3 Changed 11 years ago by Douglas Hays

suggest setting to "" for null or undefined

comment:4 Changed 11 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

This was fixed in tracker: http://trac.dojotoolkit.org/ticket/5555.

comment:5 Changed 11 years ago by (none)

Milestone: 1.0.3

Milestone 1.0.3 deleted

Note: See TracTickets for help on using tickets.