I have an AJAX call, which updates a Highcharts chart and is supposed to update a Kendo Grid, as well. The data returned from AJAX is updated, but the grid doesn't refresh.
This is the setup for the grid's dataSource:
And this is the JS for the Kendo Grid:
I had thought this would work, but the grid stays the same. I know I must be missing a command somewhere, but I'm just not seeing it.
This is the setup for the grid's dataSource:
var
smry_data = [{
mean : rtrn_data.SUMMARY[
"Mean"
]
, std_deviation : rtrn_data.SUMMARY[
"Std. Deviation"
]
, median : rtrn_data.SUMMARY[
"Median"
]
, mode : rtrn_data.SUMMARY[
"Mode"
]
, range : rtrn_data.SUMMARY[
"Range"
]
, minimum : rtrn_data.SUMMARY[
"Minimum"
]
, maximum : rtrn_data.SUMMARY[
"Maximum"
]
, count : rtrn_data.SUMMARY[
"Count"
]
, quintile20 : rtrn_data.SUMMARY[
"Quintile 20%"
]
, quintile40 : rtrn_data.SUMMARY[
"Quintile 40%"
]
, quintile60 : rtrn_data.SUMMARY[
"Quintile 60%"
]
, quintile80 : rtrn_data.SUMMARY[
"Quintile 80%"
]
, quintile100 : rtrn_data.SUMMARY[
"Quintile 100%"
]
}];
And this is the JS for the Kendo Grid:
if
(!$(
"#cntr-smry"
).data(
"kendoGrid"
)) {
dtsc_smry_data =
new
kendo.data.DataSource({
data : smry_data
, schema : {
model : {
fields : {
mean : {type :
"number"
}
, std_deviation : {type :
"number"
}
, median : {type :
"number"
}
, mode : {type :
"number"
}
, range : {type :
"number"
}
, minimum : {type :
"number"
}
, maximum : {type :
"number"
}
, count : {type :
"number"
}
, quintile20 : {type :
"number"
}
, quintile40 : {type :
"number"
}
, quintile60 : {type :
"number"
}
, quintile80 : {type :
"number"
}
, quintile100 : {type :
"number"
}
}
}
}
});
$(
"#cntr-smry"
).kendoGrid({
dataSource : dtsc_smry_data
, columns : [
{field :
"mean"
, title :
"Mean"
, template :
'<span style="float:right;" class="fontBold">#=kendo.toString(mean, "n1")#</span>'
}
, {field :
"std_deviation"
, title :
"Std. Deviation"
, template :
'<span style="float:right;" class="fontBold">#=kendo.toString(std_deviation, "n1")#</span>'
}
, {field :
"median"
, title :
"Median"
, template :
'<span style="float:right;" class="fontBold">#=kendo.toString(median, "n1")#</span>'
}
, {field :
"mode"
, title :
"Mode"
, template :
'<span style="float:right;" class="fontBold">#=kendo.toString(mode, "n0")#</span>'
}
, {field :
"range"
, title :
"Range"
, template :
'<span style="float:right;" class="fontBold">#=kendo.toString(range, "n1")#</span>'
}
, {field :
"minimum"
, title :
"Minimum"
, template :
'<span style="float:right;" class="fontBold">#=kendo.toString(minimum, "n1")#</span>'
}
, {field :
"maximum"
, title :
"Maximum"
, template :
'<span style="float:right;" class="fontBold">#=kendo.toString(maximum, "n1")#</span>'
}
, {field :
"count"
, title :
"Count"
, template :
'<span style="float:right;" class="fontBold">#=kendo.toString(count, "n0")#</span>'
}
, {field :
"quintile20"
, title :
"Quintile 20%"
, template :
'<span style="float:right;" class="fontBold">#=kendo.toString(quintile20, "n1")#</span>'
}
, {field :
"quintile40"
, title :
"Quintile 40%"
, template :
'<span style="float:right;" class="fontBold">#=kendo.toString(quintile40, "n1")#</span>'
}
, {field :
"quintile60"
, title :
"Quintile 60%"
, template :
'<span style="float:right;" class="fontBold">#=kendo.toString(quintile60, "n1")#</span>'
}
, {field :
"quintile80"
, title :
"Quintile 80%"
, template :
'<span style="float:right;" class="fontBold">#=kendo.toString(quintile80, "n1")#</span>'
}
, {field :
"quintile100"
, title :
"Quintile 100%"
, template :
'<span style="float:right;" class="fontBold">#=kendo.toString(quintile100, "n1")#</span>'
}
]
});
}
else
{
$(
"#cntr-smry"
).data(
"kendoGrid"
).dataSource.read();
}
I had thought this would work, but the grid stays the same. I know I must be missing a command somewhere, but I'm just not seeing it.