cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

AshishAnand
Employee
Employee
0 Kudos

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

Hi Ashish,

Thanks for your reply.

It helped me very much! 🙂

Answers (0)