I try set dataModel.data option and have I a problem.
This is my code:
$('div#pqgrid').pqGrid("option", "dataModel.data", response.data);
$('div#pqgrid').pqGrid("refreshDataAndView");
console.log(response.data);
console.log($('div#pqgrid').pqGrid("option", "dataModel.data")); //return null
$('div#pqgrid').pqGrid( "filter", {
data: [
{ oper: 'replace', dataIndx: 'ID', condition: 'contain', value: campaignRef }
]
});
My problem is filter below data setter is not working. (exactly show empty results)
Althought I set dataModel.data the console.log return null.
I thought refreshDataAndView working asynchronous but when I comment filter, console.log with dataModel.data return valid results:
$('div#pqgrid').pqGrid("option", "dataModel.data", response.data);
$('div#pqgrid').pqGrid("refreshDataAndView");
console.log(response.data);
console.log($('div#pqgrid').pqGrid("option", "dataModel.data")); //return valid data
//$('div#pqgrid').pqGrid( "filter", {
//data: [
// { oper: 'replace', dataIndx: 'ID', condition: 'contain', value: campaignRef }
//]
//});
filterModel.type and dataModel.location are "local"
I will be very grateful for help.