Question

Background color to lookup field

Hi community!
            I have a lookup column based on the, lookup column filled in I need to give background color to another field. Similar to the attached image. Is it possible in freedom UI. How can we achieve this?. Thanks in advance.

Like 0

Like

4 comments
Best reply

I have an article that shows how to dynamically change the style of a control here https://customerfx.com/article/dynamically-changing-a-control-style-on-a-creatio-freedom-ui-page/

Also you’ll need to have a change event for the lookup so you can set the style of the other field when it changes, you can see how to do that here https://customerfx.com/article/responding-to-an-event-when-a-field-is-changed-on-a-creatio-freedom-ui-page/

Ryan

I have an article that shows how to dynamically change the style of a control here https://customerfx.com/article/dynamically-changing-a-control-style-on-a-creatio-freedom-ui-page/

Also you’ll need to have a change event for the lookup so you can set the style of the other field when it changes, you can see how to do that here https://customerfx.com/article/responding-to-an-event-when-a-field-is-changed-on-a-creatio-freedom-ui-page/

Ryan

Ryan Farley,

Thank you. 

Ryan Farley,

Hi Ryan, 

 

I have done CSS like this 

body #ComboBox_ewb0js6 > div > div > div.crt-combobox-container > div > crt-autocomplete > mat-form-field > div > div.mat-form-field-flex.ng-tns-c6-22 > div.mat-form-field-infix.ng-tns-c6-22 > div > div > crt-link > a .cfx-service-hold {
   border-color: #ffcc99;
   border-style: solid;
   border-width: 3px;
   background: #ffcc99;
}

Condition:
 if(request.$context.LeadDS_UsrReassignedOwner_54it6l1.__zone_symbol__value!= undefined || 
            request.$context.LeadDS_UsrReassignedOwner_54it6l1.__zone_symbol__value!= null){
          // request.$context.ChangeOwnerButtonVisible = false;
        if (request.value) {
               request.$context.ServiceHoldClass = ["cfx-service-hold"];
           }
           else {
               request.$context.ServiceHoldClass = [];
           }
           }


without this .cfx-service-hold the field is colored but based on condition its not working. Can you please help on this. Thanks in advance
 

The selector you're using isn't correct. You need to inspect the rendered HTML in dev tools to see where the CSS class is getting added, then use that for the CSS selector. I believe it would be something more like this (but just guessing that the CSS class is added to the top level crt-combobox element "ComboBox_ewb0js6", you'll need to inspect to determine for sure)

#ComboBox_ewb0js6.cfx-service-hold .crt-combobox-field-container {
    border-color: #ffcc99;
    border-style: solid;
    border-width: 3px;
    background: #ffcc99;
}

Ryan

Show all comments