1
Help for ParamQuery Grid (free version) / Re: how to work with the column filter without invoking the listener action...
« on: September 17, 2016, 02:15:22 am »
I meant to show this code earlier...
var colM = $("#grid_students").pqGrid("option", "colModel");
var fltr = $("#grid_students").pqGrid("option", "filterModel");
var filter = colM[3].filter;
var fMode = fltr.mode;
var pq_filter = {
"mode": fMode,
"data": [{
"dataIndx": colM[3].dataIndx,
"value": filter.value,
"condition": filter.condition,
"dataType": colM[3].dataType,
"cbFn": ""
}]
};
alert(JSON.stringify(pq_filter));
$.ajax({
url: window.location.origin + "/Students/printStudentGrid/",
type: "POST",
data: JSON.stringify(pq_filter),
contentType: "application/json; charset=utf-8",
dataType: "json",
error: function (response) {
showFailMessage(response.responseText, 'Generate Template Failed!');
//alert(response.responseText);
},
success: function (data) {
//alert(JSON.stringify(data));
var response = JSON.parse(JSON.stringify(data));
window.location = '/Students/Download?fileGuid=' + response.FileGuid + '&fileName=' + response.FileName;
//showSuccessMessage("Success!", 'Success!');
}
});
}
In the tools, the json object looks exactly like the one that gets passed natively...still not working. See the attached image.
Thanks.
var colM = $("#grid_students").pqGrid("option", "colModel");
var fltr = $("#grid_students").pqGrid("option", "filterModel");
var filter = colM[3].filter;
var fMode = fltr.mode;
var pq_filter = {
"mode": fMode,
"data": [{
"dataIndx": colM[3].dataIndx,
"value": filter.value,
"condition": filter.condition,
"dataType": colM[3].dataType,
"cbFn": ""
}]
};
alert(JSON.stringify(pq_filter));
$.ajax({
url: window.location.origin + "/Students/printStudentGrid/",
type: "POST",
data: JSON.stringify(pq_filter),
contentType: "application/json; charset=utf-8",
dataType: "json",
error: function (response) {
showFailMessage(response.responseText, 'Generate Template Failed!');
//alert(response.responseText);
},
success: function (data) {
//alert(JSON.stringify(data));
var response = JSON.parse(JSON.stringify(data));
window.location = '/Students/Download?fileGuid=' + response.FileGuid + '&fileName=' + response.FileName;
//showSuccessMessage("Success!", 'Success!');
}
});
}
In the tools, the json object looks exactly like the one that gets passed natively...still not working. See the attached image.
Thanks.