How to add html field in childtable

Hello, how can i show data in an HTML field in a childtable here below am trying but am getting an error? petails is not found

frappe.ui.form.on_change('Viehal', {
	"tools": function(frm,cdt,cdn) {
		let row = locals[cdt][cdn];

		let html='<div class="grid-container">';
		html+='<div id="accordion">';

		html+= `<div><h2>Title 2</h2></div>`
		html+='</div>';
		html+='</div>';
		 row.fields_dict.petails.html(html);
	},
});

@imbra
frappe.model.set_value(cdt, cdn, ‘your field name’, value to set);

For child table, HTML field

sorry this will work for value set in HTML editor Not in HTML

But am trying to add data in HTML field that is in a child table

Hello @imbra Have you got any solution for how to add html in html field for a child table?

frappe.ui.form.on('Viehal', {
    tools: function(frm, cdt, cdn) {
        let row = locals[cdt][cdn];
        $(frappe.get_field(cdt, cdn, 'petails').wrapper).html(`
            <div class="grid-container">
                <div id="accordion">
                    <div><h2>Title 2</h2></div>
                </div>
            </div>
        `);
    }
});

1 Like