Reputation: 638
I am trying to follow the tutorial here:
http://dojotoolkit.org/documentation/tutorials/1.7/store_driven_grid/
The tutorial writes:
require(["dojo/store/JsonRest"], function(JsonRest){
myStore = new JsonRest({target:"MyData/"});
My MyData.json file is placed in ROOT\MyData. If I run the following code
...
<script>
var myStore, dataStore, grid;
require(["dojo/store/JsonRest"], function(JsonRest){
myStore = new JsonRest({target:"MyData/"});
});
require(["dojox/grid/DataGrid",
"dojo/data/ObjectStore",
"dojo/domReady!"
], function(DataGrid, ObjectStore){
grid = new DataGrid({
store: dataStore = ObjectStore({objectStore: myStore}),
structure: [
{name:"State Name", field:"name", width: "200px"},
{name:"Abbreviation", field:"abbreviation", width: "200px"}
]
}, "target-node-id"); // make sure you have a target HTML element with this id
grid.startup();
});
</script>
...
I get a 404 error on the data if I write "MyData/" and a 416 (Requested Range Not Satisfiable) if I put "MyData/MyData.json".
I know it is something totally stupid, since I can't find anyone have the same problem, but I am unable to see the solution :/
Best regards and thank you for your help!
Andreas
Upvotes: 0
Views: 3175
Reputation: 261
Ok so the data you are providing is not enough to determine whats the problem, but 404 is not found.
So:
E.g. If your grid script is in http://localhost/grid/, then the JsonRest will look relative to this path. For a target {target:"MyData.json"} it will look in http://localhost/grid/MyData.json, not finding it, if it where in http://localhost/MyData.json
If you still can't solve this post again!!
Upvotes: 1