Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 


#Product
#Analytics
#CognosAnalytics
#Analyticstools
#TechXchange Partner
#TechXchange Session
#TechXchange Presenter
#AI
 View Only
  • 1.  Use Extension for Custom Control

    Posted 09/09/20 02:24 PM
    Hi @Ralf Roeber and all,

    I am trying to use extension for Custom Control Javascripts and face issue when try to refer external file​. 

    Example from IBM Sample Appbar.js:-

    define( ["text!./AppBar.css"], function( sAppBarCss ) {

    This gives error for undefined object even though I copied both js and css in same folder under Extension. 

    Please help to identify issue to make it work using Extension approach and can refer external file/JS libraries.

    Appreciate your help!

    ------------------------------
    Buddhi Gupta
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: Use Extension for Custom Control

    Posted 09/11/20 01:30 AM
    I use the following pattern when writing JS:

    //Create link to myCSS.css
    if(!document.getElementById('myCSS')){
    var cssFile = document.createElement('link');
    cssFile.rel = 'stylesheet';
    cssFile.type = 'text/css';
    cssFile.id='myCSS';
    cssFile.href = './myCSS.css';
    document.getElementsByTagName('head')[0].appendChild(cssFile)
    }


    ------------------------------
    Paul Mendelson
    ------------------------------