Skip to Content
0
Jan 02, 2019 at 03:29 PM

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

524 Views

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