Author Topic: An error occurs when refreshDataAndView is called in IE.  (Read 2289 times)

eloan

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 25
    • View Profile
An error occurs when refreshDataAndView is called in IE.
« on: April 24, 2020, 01:43:51 pm »
Hi.

Please help me.

I have upgraded the version of pqgrid from 3.3.4 to 7.0.0.
Then I get an error and am in trouble.

I used refreshDataAndView method.
Then, an error occurs in IE.
Call t at line 557 of pqgrid.dev.php, but t is undefined.

It does not occur in chrome or firefox.

It can be confirmed by displaying the "test simple html" below in the IE browser and "IE developer tool" and clicking the "refresh" link.

Best regards.

=== test simple html ===
<body>
<a href="#" onclick="refresh(); return false;">reload</a>
<div id="testGrid"></div>
<script>
function refresh() {
   $("#testGrid").show();
   $("#testGrid").pqGrid('option', 'dataModel.location', "remote");
   $("#testGrid").pqGrid('option', 'dataModel.postData', []);
   $("#testGrid").pqGrid('refreshDataAndView');
}

$(function() {
   var colModel = [{"title":"ID","dataType":"string","dataIndx":"id"}
            ,   {"title":"name","dataType":"string","dataIndx":"name"}
            ];
   var dataModel = {"location":"remote"
               ,"dataType":"JSON"
               ,"method":"POST"
               ,"url":"https:\/\/paramquery.com\/pro\/orders\/get"};

   var obj = {"width":"auto","height":"400","minHeight":"200","showTitle":true,"stripeRows":true,"showTop":false};
   obj.colModel = colModel;
   obj.dataModel = dataModel;
   var grid = $("#testGrid").pqGrid(obj);
   
});
</script>
</body>
==================

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6255
    • View Profile
Re: An error occurs when refreshDataAndView is called in IE.
« Reply #1 on: April 27, 2020, 09:06:09 am »
Please mention version of IE, jQuery and jQueryUI.

eloan

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: An error occurs when refreshDataAndView is called in IE.
« Reply #2 on: April 27, 2020, 09:23:13 am »
IE version is 11.(debug mode 9 - 10, edge)
jquery version is 1.8.3
jquery-ui version is 1.12.1

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6255
    • View Profile
Re: An error occurs when refreshDataAndView is called in IE.
« Reply #3 on: April 27, 2020, 11:52:46 am »
dataModel.postData is not an array but a plain object or a function.

Please correct this

Code: [Select]
$("#testGrid").pqGrid('option', 'dataModel.postData', []);

to

Code: [Select]
$("#testGrid").pqGrid('option', 'dataModel.postData', {});

eloan

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: An error occurs when refreshDataAndView is called in IE.
« Reply #4 on: April 27, 2020, 01:53:02 pm »
Thank you very much.
The problem is resolved.
It was helpful.