I am using JSON for first time... and want to fill my datagrid with my JSON data, this is my JSON data :
{
\"head\": {
\"vars\": [ \"s\" , \"fname\" ,
There is a mistake in load call, it is an async call then when you try to build the grid you don't have the data and the store cannot be built as needed. You can include everything in load function as shown below:
var items,store;
var ss = dojo.xhrGet({
url: "http://localhost:8477/E-Governance/listPerson",
handleAs: "json",
preventCache: true,
load: function(data){
items = dojo.map(data.results.bindings, function(binding) {
return {
fname : binding.fname.value,
lname : binding.lname.value
};
});
store = new dojo.data.ItemFileReadStore({
data : {
items : items
}
});
console.log(items[0].fname+' '+items[0].lname);
_createGrid(sore);
}
});
console.log('3-4');