Change Background Color of Detail Button

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mpol_ch
User
Posts: 877
Location: Switzerland

Change Background Color of Detail Button

Post by mpol_ch »

Hello
I have the tables Customer and Calls as Master and Details. The Detail Table is shown as Button with counted number of calls.
Im my Calls tables I have a Coloumn "Status".
Is that possible to change the background color of Detail Button in relation of Status?

If Call->Status== "Callback" Then Background_cOLOUR_of_Detail_Button == "Green".

Where to start?

Thanks
mpol_ch


mobhar
User
Posts: 11765

Post by mobhar »

Simply use "Row_Rendered" server event. Read "Server Events and Client Scripts" in the help file for further information.


mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

Hello mobhar

thanks for the response. But how can I identify the linkt to detail button to the detail table. I want only change the background of button that shows the related details tables to the maser...

mpol_ch


danielc
User
Posts: 1601

Post by danielc »

Detail button is belong to ListOptions. So, you need to use ListOptions_Rendered server event:
if (your condition)
$this->ListOptions->Items["details"]->CssStyle = "background-color: green"; // change the cell background color to green
else
$this->ListOptions->Items["details"]->CssStyle = "white-space: nowrap;";

You may check your html source to see the item name. If you are not using multiple detail table, the name will become items["detail_yourdetailtable"].

If you want to change button color, you need to write your jquery code.


Post Reply