-
7 Nov 2012 12:40 PM #1Sencha Premium Member
- Join Date
- May 2012
- Location
- General Electric, Foxboro, MA
- Posts
- 45
- Vote Rating
- 3
DataView value bug
DataView value bug
Not so much a question as a bug report...
We have found that when using the dataitem object with numeric values, the dataview fails to display the value of integer 0. The issue was traced down the sencha doMapData function, which is supposed to be checking for null or undefined, but is also failing the boolean check because the value of zero will cause the if statement to evaluate to false. For example, we have a setterName of "KPIValue" with the value of 0 (integer). Instead of displaying 0 on the dataview, it leaves the field blank (investigation showed that the (html: 'value') field was completely missing in chrome console.)
dataitem.js :
regards,Code:doMapData: function(dataMap, data, item) { -snip- if (data && component[setterName] && data[setterMap[setterName]]) { component[setterName](data[setterMap[setterName]]); } -snip- }
-Blayne Watt
Lead Engineer
General Electric, Inc.
-
8 Nov 2012 5:41 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
Moved to the bugs forum and I have opened a bug in our bug tracker.
-
8 Nov 2012 6:14 AM #3Sencha Premium Member
- Join Date
- May 2012
- Location
- General Electric, Foxboro, MA
- Posts
- 45
- Vote Rating
- 3
As a note for anyone else encountering the issue, you can work around it by converting all your numeric values into strings, which will not evaluate to boolean false.
-
3 Dec 2012 7:29 AM #4Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
Thanks for the report! This has been fixed for the next release.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3674
in
Sprint 28.


Reply With Quote
