Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  How to change the text color or background color of a View

    Posted Fri June 05, 2020 01:35 PM
    Edited by System Admin Tue August 22, 2023 04:42 PM
    Hi,
    Is there a way to change the text color or background color of a sub-view? For example in Work Execution app on Work order details view we have sub view like Work Log and I would like to change the color of the text Work Log or background color to RED to indicate that the record exists. I understand this would require to write a java script however I'm unable to figure out the exact syntax for the same. I tried the below and it works for a field but not for views.  While using on views it gives and error as "Cannot read property 'domNode' of undefined" . I'm trying to do this in Maximo Anywhere 7.6.4.

    eventContext. textWidget.domNode.className+= 'red-text'

    Thanks,

    ------------------------------
    Vijayalakshmi Laxman
    ------------------------------


    #AssetandFacilitiesManagement
    #Maximo
    #MaximoAnywhere


  • 2.  RE: How to change the text color or background color of a View

    Posted Mon June 15, 2020 06:27 AM
    Hi Vijayalakshmi

    How are you?

    I assume the folder structure remains the same in the version 7.6.4. I have done something similar in 7.6.3, reducing the font size for a text label. I had to add a new css definition and I think it should work for your case. The file name is main.css under the folder common/css. You may have to add a new definition with the background color you wish to have. Let me know how it goes.

    ------------------------------
    Manikanda Prabhu
    Maximo Solutions Engineer
    Deloitte Ireland Maximo CoE
    ------------------------------



  • 3.  RE: How to change the text color or background color of a View

    Posted Tue June 16, 2020 01:04 AM
    Hi Mani,

    I'm fine, How are you doing ?

    Thanks a lot for the below response. I was able to get this done however in case of 7.6.4  modifying main.css in common\css does not work. We have to modify color_fonts.css present in \\app\appname\common\js\platform\ui\control\css  only then it works.

    ------------------------------
    Vijayalakshmi Laxman
    ------------------------------



  • 4.  RE: How to change the text color or background color of a View

    Posted Tue June 16, 2020 04:17 AM
    Hi

    Great to hear that. Thanks for the info.

    ------------------------------
    Manikanda Prabhu
    Maximo Solutions Engineer
    Deloitte Ireland Maximo CoE
    ------------------------------



  • 5.  RE: How to change the text color or background color of a View

    Posted Mon January 25, 2021 09:26 AM
    Hi, Can either yourself or Mani please forward an example of how this was achieved at a field level or in my case we want to set the background color of the worklist row if the worktype = 'EM' so all workorders in the list that are of Emergency Maintenance stand out from the other work orders in the list?
    Any help will be appreciated

    Regards
    Steve Lee

    ------------------------------
    Steve Lee
    Maximo Technical Sales Specialist
    IBM
    Leeds
    ------------------------------



  • 6.  RE: How to change the text color or background color of a View

    Posted Fri March 05, 2021 04:51 AM
    Hi Steve,
    Apologies for the delay!  You can add the below property in the color_fonts.css file present in \\MaximoAnywhere\apps\WorkExecution\platform\ui\control\css\mdpi

    customBackgroundColor {
    background-color: #FFE663;
    }
    Invoke this property in the WO detail handler something like below
    backgroundColor: function(eventContext){
    var currentWO = eventContext.getResource('workOrder').getCurrentRecord();
    var worktype = currentWO.get('worktype');
    if (worktype == 'EM'){
    eventContext.textWidget.domNode.className+=' customBackgroundColor';
    }
    },

    ------------------------------
    Vijayalakshmi Laxman
    ------------------------------