DataTables 1.10 in Google Apps Script (Caja issues?)
DataTables 1.10 in Google Apps Script (Caja issues?)
Hello.
I'm trying to use DataTables in a Google Apps Script. I'm using the fixed columns plugin to lock in the first column.
Everything works fine, except the "Show entries" select box is broken.
If I use 1.10, the select box is visible with no entries.
If I use 1.10 nightly, there is no select box and just the text "Show undefined entries".
I'm wondering if the CAJA parser is preventing something from working because I'm seeing several
Rejecting table.setAttribute
Rejecting a.setAttribute
error messages in the console.
Sorting, pagination, and everything else works great.
I've tried the same identical code in a test.html file, and it works great.
I've shared the Google Doc at:
https://docs.google.com/document/d/1UZQjzwC4cuER6kvJQvi9GoW7rV45htnKWi4Bu9AC4Fw/edit?usp=sharing
Thanks,
Jason
Replies
Just checking in on this topic, and realized I never set the permissions of the Google Doc to editable so no one could run the example!
I've just update the permissions.
-- Jason
For what it is worth, I have exactly that experience too.
It certainly is Caja interfering. If you use Chrome and run its Javascript Console, multiple instances of a single caja rejection are shown. However, clicking on them takes you to the Caja vetted source. Scrolling through that, you'll find may "repaired" and "can't repair" violations.
Google works closely with jQuery to ensure it remains caja safe, but it seems really hit and miss for other extensions.
The DataTables developers would have to run through and deal with every violation -- a major pain in the glootz, I'm sure.
I'd love to know that its on the road map, but I doubt if it has high priority, since jQuery in GAS is painfully slow anyway.
Did you get any solution? It would be useful to know what features of DataTables are compatible whith GAS.