Hi,
I have a Kendo Grid that autorefreshes data every 15 minutes. It also has a dynamic header with the columns as dates (past 2 days worth of data). At midnight I would expect the headers to change by 1 day (from 1/28 to 1/29 and from 1/27 to 1/28), but this is not happening, even though the data refreshes just fine and in the very first column accurately displays today's (1/29) data with the header still being for yesterday (1/28). If I manually refresh the page, everything is working perfectly, but if I'd like it to silently refresh on the background, the headers are not refreshing. Both header's data and grid's data are coming from the same data source which is refreshed every 15 minutes.
HTML:
<span data-bind="text: getDisconnectsMed" class="neutralTextMedium" > </span>
<table id="gridDisconnectsMed" style="font-size: 8pt">
<thead>
<th data-field="Description">Description</th>
<th data-field="CountDay0" data-bind="text: setDay0Label"></th>
<th data-field="CountDay1" data-bind="text: setDay1Label"></th>
</thead>
</table>
JavaScript:
var disconnectsDS = new kendo.data.DataSource({
transport: {
read: {
type: 'GET',
contentType: 'application/json; charset=utf-8',
url: getDisconnectsUrl,
dataType: 'json'
}
},
change: function (data) {
disconnectsMediumViewModel.set("returnData", data.items);
},
error: function (e) {
disconnectsMediumViewModel.set("error", e.errorThrown);
}
});
var disconnectsMediumViewModel = kendo.observable({
returnData: null,
error: "none",
if (value.length == 0) {
$("#gridDisconnectsMed").kendoGrid({
dataSource: disconnectsDS,
sortable: false,
scrollable: false
});
$("#gridDisconnectsMed").show();
}
else
$("#gridDisconnectsMed").hide();
return value;
},
setDay0Label: function () {
if (this.returnData != null && this.returnData.length > 0) {
return kendo.toString(this.returnData[0].CountDay0Label);
}
},
setDay1Label: function () {
if (this.returnData != null && this.returnData.length > 0) {
return kendo.toString(this.returnData[0].CountDay1Label);
}
}
Victoria
I have a Kendo Grid that autorefreshes data every 15 minutes. It also has a dynamic header with the columns as dates (past 2 days worth of data). At midnight I would expect the headers to change by 1 day (from 1/28 to 1/29 and from 1/27 to 1/28), but this is not happening, even though the data refreshes just fine and in the very first column accurately displays today's (1/29) data with the header still being for yesterday (1/28). If I manually refresh the page, everything is working perfectly, but if I'd like it to silently refresh on the background, the headers are not refreshing. Both header's data and grid's data are coming from the same data source which is refreshed every 15 minutes.
HTML:
<span data-bind="text: getDisconnectsMed" class="neutralTextMedium" > </span>
<table id="gridDisconnectsMed" style="font-size: 8pt">
<thead>
<th data-field="Description">Description</th>
<th data-field="CountDay0" data-bind="text: setDay0Label"></th>
<th data-field="CountDay1" data-bind="text: setDay1Label"></th>
</thead>
</table>
JavaScript:
var disconnectsDS = new kendo.data.DataSource({
transport: {
read: {
type: 'GET',
contentType: 'application/json; charset=utf-8',
url: getDisconnectsUrl,
dataType: 'json'
}
},
change: function (data) {
disconnectsMediumViewModel.set("returnData", data.items);
},
error: function (e) {
disconnectsMediumViewModel.set("error", e.errorThrown);
}
});
var disconnectsMediumViewModel = kendo.observable({
returnData: null,
error: "none",
getDisconnectsMed: function () {
var value = checkForError(this.returnData, this.error);if (value.length == 0) {
$("#gridDisconnectsMed").kendoGrid({
dataSource: disconnectsDS,
sortable: false,
scrollable: false
});
$("#gridDisconnectsMed").show();
}
else
$("#gridDisconnectsMed").hide();
return value;
},
setDay0Label: function () {
if (this.returnData != null && this.returnData.length > 0) {
return kendo.toString(this.returnData[0].CountDay0Label);
}
},
setDay1Label: function () {
if (this.returnData != null && this.returnData.length > 0) {
return kendo.toString(this.returnData[0].CountDay1Label);
}
}
});
Do you know what the issue might be?
Thanks,Do you know what the issue might be?
Victoria