Skip to content

Instantly share code, notes, and snippets.

@erikwett
Last active October 22, 2016 06:58
Show Gist options
  • Save erikwett/e028bcdbdb8095ca070b8a1c086c101e to your computer and use it in GitHub Desktop.
Save erikwett/e028bcdbdb8095ca070b8a1c086c101e to your computer and use it in GitHub Desktop.
//add a new chart when the user clicks in the list of visualizations
vislist.delegate( 'a[data-id]', "click", function ( e ) {
var id = $( this ).data( 'id' );
addChart( app, id );
} );
// dynamically add a visualization to the tabs
function addChart ( app, id ) {
//create a tab container if it does not exist
if ( !tabContainer ) {
tabContainer = new TabContainer();
}
//add a new tab and return the id
var tabid = tabContainer.addTab( title );
//call qlik to add the object to the tab
app.getObject( tabid, id );
}
//call qlik resize when tab is shown
//shown.bs.tab is the event that jQuery tabs trigger wher a new tab is shown
this.$tabs.delegate( 'a[data-toggle="tab"]', 'shown.bs.tab', function () {
qlik.resize();
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment