Picture of Stephen Harlow
Simple Interactive Table
by Stephen Harlow - Friday, 9 December 2016, 2:37 AM
 

Hi again knowledgeable Adapt users.

I want to insert an interactive table into a course. It's simply an HTML table with columns made sortable with a jQuery plugin. My question is where do I insert the script referencing and calling the jQuery? I'm using the Authoring Tool, but would be comfortable retrofitting the table sorting references after downloading the course (if I knew where to put them), then finally building it using the Framework. My other thought is to create a simple extension that calls the script on page load.

Any pointers on the simplest approach would be much appreciated.

Stephen

Picture of Matt Leathes
Re: Simple Interactive Table
by Matt Leathes - Friday, 9 December 2016, 3:43 PM
 

Well, if it's just a one-off then the simplest way is actually just to build it as a separate HTML page then include it in your course using one of the iframe plugins...

Otherwise you could look to modify core/js/scriptLoader.js to load it - but I'd be more inclined to go down the extension route. Note that as of framework 2.0.13, plugins should ideall put code like this into a 'libraries' folder - see adapt-contrib-slider for an example. Note that the build tool won't minify/uglify this code so you'll need to add the minified version if you want it like that.

Picture of Matt Leathes
Re: Simple Interactive Table
by Matt Leathes - Saturday, 10 December 2016, 4:15 PM
 

You could also add that JQuery plugin to the framework libraries folder (to ensure it's included in the build) then load it via $.getScript()