Numerical values cannot be aligned to the right on dashboard

Hi,

I created a report based on Opportunity entity, and then make it available for Interactive Dashboard. The column with numerical value is aligned to right on the report. This same report is available for a dashboard gadget, however, the numerical values for the same column are aligned to left. Is this by design, or is there any way to make the numerical values on dashboard gadget to right? Please see Company ID column in attached image file for details. Thanks a lot!

Parents
  • 0

    Hello,

    This is possible however it needs to be VERY carefully implemented.

    The following clientside code will give you what you want.

    crm.ready(function() {
    if(crm.getArg("Act") == "" && crm.getArg("contextDashboardAction") > 0) //detects you are in the dashboard screen and also that the dashboard iframe is present (the iframe src does not have an Act arg.)
    {
    //attach and event handler to detect whenever there is a change to the html of the iframe.
    //this is needed so we can run the formatting after the dashboard tables have been built
    $('.x-viewport').live('DOMSubtreeModified', function(e) {
    if($('.x-grid3-cell-inner').length > 0)//loop through cells formatting as appropriate
    {
    $('.x-grid3-cell-inner').each(function(e){
    if(!isNaN($(this).text()))//checks to see if the WHOLE text is a number
    {
    $(this).css("text-align", "right");
    }
    });
    }
    });
    }
    });

    This works by detecting when the Dashboard iFrame has been loaded and then attaching an event handler to the iFrame DOM.

    Whenever the iFrame DOM is changed (i.e. html is added or changed at the client), this event handler will fire and perform the required formatting.

    EXTREME CAUTION should be exercised as this event will fire whenever there is any change (such as when rows are highlighted), and could have a client side performance impact.

  • 0 in reply to Kieron_Moran

    Hi Kieron

    Where would you implement this code so it actions on the dashboard list?
    Thanks 

  • 0 in reply to RBC_1

    Put it in a custom js file Roger

  • 0 in reply to Sean from Spire

    Thanks Sean but reason for query is my numeric values were still left justified even though I'd put a js file into the wwwroot\js\custom folder with this script in Disappointed

Reply Children
No Data