I will explain how to export tables, or search results to xls files. I have hosted the js file in my server, but you can download the files and host in your own server if you prefer, or use my url server (no problem).
All this could also be done inside a View Render Trigger but I have thought it's easier to do so for people who don't have much experience I hope that you enjoy it.
Because I am not sure about the order of execution (everything is async, isn't it?)
Still, I've tried all the above options with dropzonejs and I couldn't make it work ($(...).something "is not a function" error). Other things worked fine (such as jQueryUI or bootstrap....). I'm still very confused on how to correctly use that.
For example, I couldn't manage to make google maps APIs to work with lazyLoad... I am actually getting it with the getScript() (which is... well... not good...)
383433730112: regarding your last question: "is possible to modify the modal content that appears when we want to export a table and add one more line"
Well, I'm not a ninja coder, but I guess you can use a mutationObserver. You can set it up to execute the callback once the div that contains the modal is created the first time and then you can fire the append with your new URL.
I do not have an example right now to show you but I used this method in the past for similar situations
Brad, so why not putting the lazyLoad outside of everything? if you put it inside the render-any, isn't it loading multiple times if you have multiple views in the same scene?
Sergi, I had a similar problem with another external script (dropzonejs) as I wanted to implement a multiple-file drag and drop upload. I couldn't get it work with lazyload, not sure why though.
I ended up writing the drag and drop upload myself from scratch........
Sergi - thanks so much for working on this as it'll be handy...
I wonder if it's becuase you're LazyLoading inside the KnackInitAsync function rather than a simple LazyLoad inside either your view render event or at the top of your code so it's available anywhere.
Well I have solved the problem, if i embed all the script inside the var buton_xls (html + script) and append into html. I don't like this solution, if anyone knows any other way to do it...
Someone with best javascript skills, could solve this doubt. About the solution before I was trying to make it more elegant by adding an export button to xls right next to the default knack export button. Everything works fine, but the terminal gives an Uncaught TypeError error: $ (...). Table2excel is not a function. But I don't understand, because this script reference is after reading the src plugin file
As an additional question, Someone with Javascript super powers, would know if it is possible to modify the modal content that appears when we want to export a table and add one more line. like this:
Commas (.CSV)
Tabs (.TXT)
JSON
XLS
The new line XLS, must to execute the table2excel function.