hi,
Can someone help me how to change the font color of Custom fields in the Detail View??
Ive made a Custom Field with a dropdown. i would like to check on a specific value and color the text red.
regards
hi,
Can someone help me how to change the font color of Custom fields in the Detail View??
Ive made a Custom Field with a dropdown. i would like to check on a specific value and color the text red.
regards
You probably have to edit modules/modulename/DetailView.html manually.
Hi!Originally Posted by gladiorlic
I agree you have to edit the code manually.
Also i think you need to write javascript code.
BTW: Please explain more exactly what you need and probably we will help you better.
Petro Blagodir
petro@blagodir.ua
http://www.blagodir.com
Blagodir Ltd.( SugarCRM - Consultations, Development and Support)
Ok.
We have made a dropdown menu for accounts where we can set the payment history. An option in this list is 'Blacklisted'.
I would like to make it more clear to our employees when an account is blacklisted. So changing the text color to red (in detailview) would make an improvement.
As an example, Accounts have dropdown field "Type", which contains values like Analyst, Competitor, Customer etc. We want to show value Analyst in red and use bold typeface.
*** added ***
Note that text is colored in detail view and list view, not in edit view.
***
The dropdown in question is called account_type_dom and can be found in language file include/language/en_us.lang.php. You could edit language file directly the following way:
Original:
'account_type_dom' =>
array (
'' => '',
'Analyst' => 'Analyst',
Changed:
'account_type_dom' =>
array (
'' => '',
'Analyst' => '<strong><font color="red">Analyst</font></strong>',
or alternatively create custom/include/language/en_us.lang.php with this content:
<?php
$app_list_strings['account_type_dom']=array ( '' => '',
'' => '',
'Analyst' => '<strong><font color="red">Analyst</font></strong>',
'Competitor' => 'Competitor',
'Customer' => 'Customer',
'Integrator' => 'Integrator',
'Investor' => 'Investor',
'Partner' => 'Partner',
'Press' => 'Press',
'Prospect' => 'Prospect',
'Reseller' => 'Reseller',
'Other' => 'Other',
);
In your case you have to locate file where your custom dropdown values are stored and edit the values manually.
Hope this helps
Last edited by Markku; 2007-06-25 at 05:09 PM.
Thanks for ur input Markku.
Ive been playing yesterday with DetailView.html and came up with the following solution.
Each value is shown in tableDetailView within a span. I gave the span element an id and retrieved the value of this element with getElementById.
This way i can not only change the color of the text, but for example change the border color of the entire table. (in my case very usefull, because employees need to be alert with these accounts)
<span sugar='slot13b' id='payment_history'>{PAYMENTHISTORY_C}</span sugar='slot'>
<script language='javascript'>
var ph = document.getElementById('payment_history');
if (ph.innerHTML == 'Blacklisted') {
var table = document.getElementById('detailtable');
table.style.borderColor = '#FF3333';
table.style.borderWidth = '4px';
ph.style.color='#FF3333';
}
</script>
Hi gladiorlic,
Great solution, way more sophisticated than my simple suggestion.
Thanks for posting it here.
I tried the quick and dirty way above by just editing the en_us.lang.php file in the custom/include folder. Unfortunately, when I view the dropdown, the HTML code is displayed along with it! Any ideas what I'm doing wrong?
$GLOBALS['app_list_strings']['client_category_list']=array (
'normal_client' => 'Normal',
'extremely_important' => '<strong><font color="red">EXTREMELY IMPORTANT</font></strong>',
'PIA' => 'PIA',
);
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks