Skip to Content

Overview Page List Cards - Change CSS using JavaScript in Custom.Controller

Hi SAP Experts,

I'm working with Overview Pages.

I've few OPV cards and I tried change Title color dinamicly writing some JS code in "Custom.Controller.js" file in three methods (onInit, onAfterRendering, onBeforeRendering) like:

...
onBeforeRendering: function () {
    var sCardCSS_02 = $("#card02Original--ovpHeaderTitle-inner"); 
    sCardCSS_02.context.body.style.color = "red";
}

But nothing happens.

If I put the same logic text in "css/style.css" file

#card03Original--ovpHeaderTitle-inner {
    color: blue!important
}

It works well.

My question - How to change CSS using JavaScript in OPV?


Regards,

Mykola

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 03 at 07:22 AM

    Hi Mykola,

    OVP does not support any extension points for such CSS modification officially. You can read more about OVP supported extension here. For CSS changes its better if you do via SAP theme designer .

    Hope it helps :)

    Thanks and Regards

    Ashish

    Add comment
    10|10000 characters needed characters exceeded