Hello,
I need to load data from ajax call where the headers are modified for security. Here is ajax call that is not modified for security but it does hit the controller and return data:
function getJsonData() {
$.ajax({
url: "http://localhost:53849/Home/PayrollAnnual/get",
type: 'GET',
contentType: 'application/json',
async: true,
success: function (dataJSON) {
return dataJSON;
}
});
}
And here is how I am calling for it.
var dataModel = {
location: "remote",
sorting: "local",
dataType: "JSON",
method: "GET",
recIndx: "Id",
getUrl: function () {
return {
url: getJsonData()
}
},
getData: function (dataJson) {
var data = dataJson ;
//expand the first row.
if (data && data.length) {
data[0]['pq_detail'] = { 'show': true };
}
return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: data };
}
}
The getJsonData method does get called and I can see data when I debug. The problem is that it never gets applied to grid. And the getData part is never hit either. Timing issue? Thoughts?
Thank you.