0

I have a pop up window which contains a datatable, the data is showing in firefox and chrome perfectly.

In IE (I have IE 9) i get no data and the message 'No data available in table'.

If i do

console.log(historyArray);

I do get the data in the console.

Here is the datatable code, how can i resolve the IE issue?

   myTable = $('#report').dataTable({
     "aaData": historyArray,
     "aoColumns": [{
       "mDataProp": "User"
     }, {
       "mDataProp": "Timestamp"
     }, {
       "mDataProp": "Latitude"
     }, {
       "mDataProp": "Longitude"
     }, {
       "mDataProp": "Address"
     }],
     "bPaginate": false,
     "bJQueryUI": true,
     "sDom": '<"H"Tfr>t<"F"ip>',
     "oTableTools": {
       "sSwfPath": "swf/copy_csv_xls_pdf.swf",
       "aButtons": ["copy", "csv", "xls", "pdf"]
     },
     "fnInitComplete": function () {
       addClasses();
     }
   });

FIX UPDATE

For some reason datatables didn't want to use the array fetched by window.opener even though it was received ok.

I fixed it by creating a new array and pushing the values into it. Then give the newArray data to datatables.

 var newArray = [];
 var historyArray = window.opener.historyArray;

 for (var key in historyArray) {
   newArray.push(historyArray[key])
 }
0

2 Answers 2

1

According to the console log the problem is here:

window.opener.closeReportWindow();

It says:

SCRIPT438: Object doesn't support property or method 'closeReportWindow' 

Try this instead:

window.close();

Also update your jQuery to version 1.7.2.

Sign up to request clarification or add additional context in comments.

8 Comments

sorry i excluded closeReportWindow() from my sample page. I have updated it now. Problem persists.
@VinceLowe Can you update jQuery and then put it up? code.jquery.com/jquery-1.7.2.min.js I just want to make sure it is not caused by the old jquery.
@VinceLowe can you comment out this line: console.log(historyArray); The problem has to be related to that array. Either it is not formatted correctly (and IE is going to complain) or there is something weird going on :) Just wondering, why do you put the table on a separate page?
i commented it. It is on a separate page because the main application is flex which i am upgrading from the old flash maps api to javascript v3 api. For this i had to put the map in an iframe. and on the map i have a 'Report' button so you can save the map data. Having a pop up window seemed the best option. Unless i could have the table in some kind of modal window over the map but i didnt know how.
@VinceLowe Try this jqueryui.com/demos/dialog/#modal while we try to fix this.
|
0

FIX UPDATE

For some reason datatables didn't want to use the array fetched by window.opener even though it was received ok.

I fixed it by creating a new array and pushing the values into it. Then give the newArray data to datatables.

 var newArray = [];
 var historyArray = window.opener.historyArray;

 for (var key in historyArray) {
   newArray.push(historyArray[key])
 }

3 Comments

Interesting.... This would suggest that the historyArray wasn't passed to Datatables by the IE js system... IE is a real pain....
@Iro tell me about it, i have been worrying about that all day. thanks for your direction.
I deal with IE7/8 at work as the company decided to use IE as a standard. There were plenty of times that I was debating throwing the computer from the 32nd floor :P IE just needs to go or be at version 10 which shows some promise, not much though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.