Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//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