Hello,
I am a Telerik newbie so this may be an easy answer:
I have view with several Grids.
The grid in question ("WorkSpace") get loaded based on user input. The grid renders with the proper data and also can save edits properly.
However, whenever I reload the Grid it will not pull the updated data. The db code behind data methods are not getting called/Executed. Grid just reloads old dataset
Question: How can I force grid to render with latest data rather than cached?
function loadDataProfile(id) {
var result = true;
var rows;
var grid = $("#WorkingSeries").data("kendoGrid");
$.ajax({ url: baseUrl + '/EyascoDB/GetDataProfile?id=' + id,
async: false,
type: 'GET',
dataType: 'JSON',
success: function (data) {
$("#txtProfileName").val(data[0].dprOwner + " / " + data[0].dprName)
if (data[0].dprPublic) {
$("#txtProfileName").css("color", "green");
} else {
$("#txtProfileName").css("color", "blue");
}
},
error: function () {
result = false;
}
});
$.ajax({ url: baseUrl + '/EyascoDB/GetProfileSeriesByProfileID?id=' + id,
async: false,
type: 'GET',
dataType: 'JSON',
success: function (data) {
rows = data;
},
error: function () {
result = false;
}
});
for (var i = 0; i < rows.length; i++) {
grid.dataSource.add({
id: rows[i].id,
Type: rows[i].Type,
Name: rows[i].Name,
Lookup: rows[i].Lookup,
Units: rows[i].Units,
StartDate: dateFormat(new Date(parseInt(rows[i].StartDate.substring(6)))),
EndDate: dateFormat(new Date(parseInt(rows[i].EndDate.substring(6)))),
HideQAFail: rows[i].HideQAFail,
MultiChart: rows[i].MultiChart
});
$.ajax({ url: baseUrl + '/EyascoDB/GetSeriesDetailsBySeriesID?ProfileID=' + id + '&RowID=' + rows[i].id,
async: false,
type: 'GET',
dataType: 'JSON',
success: function (data) {
details = data;
},
error: function (errorMsg) {
var e = errorMsg
result = false;
}
});
//adds the associated Series Details
sd = new Object();
// sd.ShowGaps = false;
sd.NativeTimeSteps = details.NativeTimeSteps;
sd.GapHandlingAlgorithm = details.GapHandlingAlgorithm;
sd.ShowQuality = details.ShowQuality;
seriesDetails.push(sd);
}
return result;
}
I am a Telerik newbie so this may be an easy answer:
I have view with several Grids.
The grid in question ("WorkSpace") get loaded based on user input. The grid renders with the proper data and also can save edits properly.
However, whenever I reload the Grid it will not pull the updated data. The db code behind data methods are not getting called/Executed. Grid just reloads old dataset
Question: How can I force grid to render with latest data rather than cached?
function loadDataProfile(id) {
var result = true;
var rows;
var grid = $("#WorkingSeries").data("kendoGrid");
$.ajax({ url: baseUrl + '/EyascoDB/GetDataProfile?id=' + id,
async: false,
type: 'GET',
dataType: 'JSON',
success: function (data) {
$("#txtProfileName").val(data[0].dprOwner + " / " + data[0].dprName)
if (data[0].dprPublic) {
$("#txtProfileName").css("color", "green");
} else {
$("#txtProfileName").css("color", "blue");
}
},
error: function () {
result = false;
}
});
$.ajax({ url: baseUrl + '/EyascoDB/GetProfileSeriesByProfileID?id=' + id,
async: false,
type: 'GET',
dataType: 'JSON',
success: function (data) {
rows = data;
},
error: function () {
result = false;
}
});
for (var i = 0; i < rows.length; i++) {
grid.dataSource.add({
id: rows[i].id,
Type: rows[i].Type,
Name: rows[i].Name,
Lookup: rows[i].Lookup,
Units: rows[i].Units,
StartDate: dateFormat(new Date(parseInt(rows[i].StartDate.substring(6)))),
EndDate: dateFormat(new Date(parseInt(rows[i].EndDate.substring(6)))),
HideQAFail: rows[i].HideQAFail,
MultiChart: rows[i].MultiChart
});
$.ajax({ url: baseUrl + '/EyascoDB/GetSeriesDetailsBySeriesID?ProfileID=' + id + '&RowID=' + rows[i].id,
async: false,
type: 'GET',
dataType: 'JSON',
success: function (data) {
details = data;
},
error: function (errorMsg) {
var e = errorMsg
result = false;
}
});
//adds the associated Series Details
sd = new Object();
// sd.ShowGaps = false;
sd.NativeTimeSteps = details.NativeTimeSteps;
sd.GapHandlingAlgorithm = details.GapHandlingAlgorithm;
sd.ShowQuality = details.ShowQuality;
seriesDetails.push(sd);
}
return result;
}