Hey guys,
I think this may count as a bug. If you run your examples and run the search example, everything is OK by default, but if you change any of the prices property of the objects in the searchResults.txt file to 0.00, the entire template will fail to load.
For example take ....
{
"id": 3,
"name": "A blue mouse",
"price": 25.50,
"tags": ["blue", "mouse"],
"dimensions": {
"length": 3.1,
"width": 1.0,
"height": 1.0
},
"warehouseLocation": {
"latitude": 54.4,
"longitude": -32.7
}
}
and change to
{
"id": 3,
"name": "A blue mouse",
"price": 00.00,
"tags": ["blue", "mouse"],
"dimensions": {
"length": 3.1,
"width": 1.0,
"height": 1.0
},
"warehouseLocation": {
"latitude": 54.4,
"longitude": -32.7
}
}
will cause the issue. I think that it may also occur on null values also. The hack I put in to fix this is arounf line 312 of the javascript file.
if (value && dataBindFunction) {
dataBindFunction($this, value);
} else if (noDataFunction) {
noDataFunction($this);
}
I changed to
if ((value || value == 0 || value == '') && dataBindFunction) {
dataBindFunction($this, value);
} else if (noDataFunction) {
noDataFunction($this);
}
Thanks guys. This is an awesome project that has saved me on multiple occasions already is a big contribution to the community.
-Frank