Format Widget Title

Comments

10 comments

  • Avatar
    Sam Ovenshine

    Hi Bharath,

    I don't know of any pre-existing scripts online that do this. I would recommend building out the script above and using our JavaScript API to grab the text you want to use and assigning prism.activeWidget.title to it.

    https://developer.sisense.com/display/API2/JavaScript+API+Reference

    widget.on('ready', function(w,e){ 
    prism.activeWidget.title='My New Title' 
    })
    1
    Comment actions Permalink
  • Avatar
    Chris Borbas

    When I add the code above to my widget (removing the color option), the title of the widget is now partially covered.  We are using SiSense 5.7.0.161.  Is there a means of expanding the amount of space allocated to the widget title?

    0
    Comment actions Permalink
  • Avatar
    Douglas

    Hi Chis,

    Please use this code below.

     

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

    /*Change the Widget Title's Background Color and Height**/

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

     

    widget.on('ready', function(se, ev){

     

     $(element).css('background-color','#EFEFEF'); //changes the widget's background

                    $('widget-header' ,element.parent()).css({'background-color':'#252526','height':'45px'}); //changes the widget's title background

    })

    0
    Comment actions Permalink
  • Avatar
    Alexandros Antoniou

    how do I change the title's font color.

    I tried 

    widget.on('ready', function(se, ev){

       $('widget-title', element.parent()).css({'color':'darkcyan'}); 

    })

    but it doesn't work

    0
    Comment actions Permalink
  • Avatar
    Sisense Admin

    This script does not work.  Looks like someone posted in March that it did not work for them either.  Is this browser specific?  I have implemented other scripts that worked for background colors, but not for the title font color.   Please help.

     

    Monty

    0
    Comment actions Permalink
  • Avatar
    Douglas

    Hi Monty,

    The dashboard has to be in view mode (TV button on the top right) for the title to show up with the implemented CSS changes.  Furthermore, after you have saved your script, please remember to refresh the page before hitting Apply on that widget.  

    Thank you

    Douglas

    0
    Comment actions Permalink
  • Avatar
    Bharath Subramaniam

    can we create dynamic heading in sisense?

    0
    Comment actions Permalink
  • Avatar
    Tyler Shaw

    I'm having a hard time getting this to work. Even after changing the font size or oclor variables, the title of the widgets do not update

    0
    Comment actions Permalink
  • Avatar
    Aditya Mankare

    Can this be done on the dashboard level? 

    The script below works for me on the widget level, but I need those changes on the dashboard level as well....

    widget.on('ready', function(w,e){ 
    prism.activeWidget.title='My New Title' 
    })
    0
    Comment actions Permalink
  • Avatar
    Ravid Paldi

    Hi Adiya, 

     

    Yes, it can be done at the dahsboard level. Simply move youru logic to the dashboard script, and change it to work with the "dashboardloaded" event and then loop through all its widget.$$widget property to update their titles

    Goog luck (: 

    Ravid

    0
    Comment actions Permalink

Please sign in to leave a comment.