I have been fighting this thing all day. Would someone please look at this code and tell me what I am doing wrong?
It is supposed to load some json with a datasource into a grid. According to the console (the iso one) the resultset has no rows. But the json file has 3 rows.
The code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ISO Test</title>
<SCRIPT>var isomorphicDir="/isomorphic/";</SCRIPT>
<SCRIPT SRC=/isomorphic/system/modules/ISC_Core.js></SCRIPT>
<SCRIPT SRC=/isomorphic/system/modules/ISC_Foundation.js></SCRIPT>
<SCRIPT SRC=/isomorphic/system/modules/ISC_Containers.js></SCRIPT>
<SCRIPT SRC=/isomorphic/system/modules/ISC_Grids.js></SCRIPT>
<SCRIPT SRC=/isomorphic/system/modules/ISC_Forms.js></SCRIPT>
<SCRIPT SRC=/isomorphic/system/modules/ISC_DataBinding.js></SCRIPT>
<SCRIPT SRC=/isomorphic/skins/SmartClient/load_skin.js></SCRIPT>
<script>
isc.DataSource.create({
ID:"markers",
dataURL:"/phptest/example.json",
dataFormat:"json",
fields: [
{type:"text", name: "markers.lat", title: "Lat"},
{type:"text", name: "markers.lng", title: "Lon"},
{type:"text", name: "markers.html", title: "Description"}
]
});
</script>
</head>
<body>
<div>
<SCRIPT>
isc.Button.create({
title:"Hello",
click:"isc.say('Hello World')"
})
</SCRIPT>
</div>
<div id="gridDiv">
<script>
isc.ListGrid.create({
ID: "markersGrid",
width:500, height:224, alternateRecordStyles:true, showAllRecords:true,
dataSource: markers,
autoFetchData: true
});
</script>
</div>
</body></html>
The json file:
{"markers": [
{"lat":43.65654, "lng":-79.90138, "html":"Some stuff to display in the<br>First Info Window","label":"Marker One"},
{"lat":43.91892, "lng":-78.89231, "html":"Some stuff to display in the<br>Second Info Window","label":"Marker Two"},
{"lat":43.82589, "lng":-79.10040, "html":"Some stuff to display in the<br>Third Info Window","label":"Marker Three"}
],
"lines": [
{"colour":"#FF0000", "width":2, "points":[ {"lat":43.65654 ,"lng":-79.90138 },
{"lat":43.91892 ,"lng":-78.89231 },
{"lat":43.82589 ,"lng":-79.10040 }
]
},
{"colour":"#008800", "width":4, "points":[ {"lat":43.9078 ,"lng":-79.0264 },
{"lat":44.1037 ,"lng":-79.6294 },
{"lat":43.5908 ,"lng":-79.2567 },
{"lat":44.2248 ,"lng":-79.2567 },
{"lat":43.7119 ,"lng":-79.6294 },
{"lat":43.9078 ,"lng":-79.0264 }
]
}
]
}