Can we change the color of the section with the different colors?

Hi,
I need to change the color of the section, can we change the color of the section with the different colors?
e.g. we have two sections separate with section break first section is A and the second is B. Can we change the color of these sections?

Thankyou

2 Likes

Hi @Sakshi_Choudhary,

We did set on lead so please check it and apply it.

here, contact_info_tab and organization_section is the field name of section.

frappe.ui.form.on('Lead', {
    refresh: function(frm) {
        frm.fields_dict['contact_info_tab'].wrapper.css('background-color', 'antiquewhite');
        frm.fields_dict['organization_section'].wrapper.css('background-color', 'cadetblue');
    }
});

Thank You!

19 Likes

Working Perfectly Thank you So much :slightly_smiling_face:

Hello
please
Where do we put this code exactly?

Hi @ese-it,

In Custom/client script.

Select doctype and Apply to your according.

Thank You!

1 Like

@NCP somewhat unrelated question… how did you get the brand logo to show in full? any custom script implemented?

Hi @flexy2ky,

No,

We added a logo in Navbar Setting.

Thank You!

Thank you My Frind

@NCP hey nihantra is there any way we can colour the rows of the grid in child table based on some logic. thank you in advance

Hi @Parth_Vashista,

Please check the syntax.

frappe.ui.form.on('DocType', {
    refresh: function(frm) {
        // select the first row in the child table
        var rows = document.getElementsByClassName("grid-row");
            for (var i = 0; i < rows.length; i++) {
              rows[i].style.backgroundColor = "cadetblue";
            }
    }
});

Note: Next time, Please create a new thread for new issue.

Thank You!

1 Like

Noted Thank you

@ncp, Great Job. it works perfectly. Thanks for your contribution.