Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.

Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.

JhonGalanteJhonGalante Posts: 5Questions: 2Answers: 0
edited August 2017 in Free community support

Good morning, everyone. Could someone help me? I'm trying to implement export buttons at my Datatable, but when I try to click "CSV, Excel and PDF" button, I got this error "Uncaught TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'. at buttons.html5.min.js:formatted:122", and I really don't know what to do. It just happens at Chrome and Firefox, but IE works fine!

Edit: Oh yes, I got this error just when I open the page by a server, but when I just open the html file, it works fine in the Chrome, Firefox and IE, but, by the server, just in IE.

Answers

  • kthorngrenkthorngren Posts: 21,309Questions: 26Answers: 4,947

    There appears to be another post with your error.
    https://datatables.net/forums/discussion/comment/104760/#Comment_104760

    Looks like the developer asked for a link to the code to troubleshoot.

    I would start by verifying the versions of Datatables and buttons you have. If you can't link to your page then maybe you can provide a test case with your specific code versions and config.

    Kevin

  • JhonGalanteJhonGalante Posts: 5Questions: 2Answers: 0

    I figured out something that may help understand. I see a difference between the "offline" version of the page and the "intraweb" version, where I got the error, in the MouseEvent.

    In the "offline" version, "MouseEvent" get the "click" event normally, but in the "intraweb" version, it keeps empty, and I get error just right next.

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    We'd really need a link to a page showing the issue please. Without that its virtually impossible to debug the problem.

    Allan

  • JhonGalanteJhonGalante Posts: 5Questions: 2Answers: 0

    My page has a lot of local file, and it's on intranet, so I don't know how send u a link.

  • JhonGalanteJhonGalante Posts: 5Questions: 2Answers: 0

    I solve the problem. I modified the "MouseEvent" of the buttons.html5.min.js, deleted the "new MouseEvent('click')" and put "var evt = document.createEvent("MouseEvents");
    evt.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null);" and it works at all browsers.

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    What browser was this in please? I'm guessing IE? Was it running in some compatibility mode?

    Allan

This discussion has been closed.