Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sense2.2 Extension How to add scripts and Css in the default Js

Hi All,

When creating extension, with earlier version, i used to have the option to add scripts and even css into the main/defaul Js file.

Like shown below.

/*globals define*/

define( ["jquery", "text!./style.css"   ]

    ,

   function ( $, cssContent )

    {

  'use strict';

  $( "<style>" ).html( cssContent ).appendTo( "head" );

  // *****************************************************************************

   // Dimensions & Measures

   // *****************************************************************************

.

.

.

.

paint: function ( $element,layout )

       {
..

html += '<script>  $(".boldtable TD").css({"background-color":"'+ colorHeaderBKColor +'"});   ';

  html += '         $(".boldtable TD").css({"color":"'+ colorHeaderFontColor+'"});  ';

  html += '         $(".boldtable TD").css({"font-size":"'+ vHeaderFontSize+'px"});  ';

  html += '     $(".boldtable TD").css({"text-align":"'+ vAlighText+'"});  ';

  html += '     $(".boldtable TD").css({"font-family":"'+ colorHeaderFontFamily+'"});  ';

  html += '   $(".boldtableRow TD").css({"background-color":"'+ colorRowBKColor +'"});   ';

  

     html += '         $(".boldtableRow TD").css({"color":"'+ colorRowFontColor+'"});  ';

  html += '         $(".boldtableRow TD").css({"font-size":"'+ vRowFontSize+'px"});  ';

  html += '     $(".boldtableRow TD").css({"text-align":"'+ vAlighText+'"});  ';

  html += '     $(".boldtableRow TD").css({"font-family":"'+ colorRowFontFamily+'"});  ';

  

  html += '</script>';

....

However with the version 2.2, i dont know how to do it.
Can anyone point out how to do that ?

0 Replies