Can we assing Primary Class to a button in Child Table Dialog?

Hello,

I have field of type Button in a Child Table.
This button shows up in Modal, when user clicks the Edit button of a Child Table row.

Currently this button looks very dry and is not easily noticeable.

Here is how it looks:
image
I have marked it with red border to show how unnoticeable it is.

Can we assign a style class like btn-primary to it.

I tried this code

frm.get_field("operations").grid.wrapper.find('btn_start').addClass('btn-primary');

But it did not work for me.

TIA

Yogi Yang

Hi @YogiYang,

Please check it.

We updated in Quotation Item for the stock balance button.

frappe.ui.form.on('Quotation Item', {
    form_render(frm, cdt, cdn){
        frm.fields_dict.items.grid.wrapper.find('.btn-default').addClass("btn-primary").removeClass("btn-default");
    }
});

In your case,

frm.fields_dict.operations.grid.wrapper.find('.btn-default').addClass("btn-primary").removeClass("btn-default");

Please set your according.
Then reload and check it.

Thank You!

2 Likes

Hello,

Yes!! This worked!!

TIA

Yogi Yang