Child table values in custom dialog box

Hi guys, i need some help with loading entire child table in one doctype as it is onto a dialog box which also have a table there . i need to populate entire child table values as it is in the table present in dialog box .
Please any suggestions

Why do you want an entire child table in a dialog box, frappe would not do this for you, you have to handle it yourself this include [load, refresh, update delete and more].

That said, if it’s you just wanted the read-only version of the child table that is easy a simple JavaScript and HTML that can also include jinja template

Can you please give an example

Yes but what is your use case what fields are you calling from the child doctype?
what is the whitelisted method you are calling?

I have a 3 column child table in one doctype that has some values in it and a button somewhere in the doctype. when the button is clicked it opens a dialog box that also has a 3 column table . The case is when the dialog box opens i want the entire child table rows in the table present in dialog box .

@mini You can do that by putting a workaround in to your Client Script that has the dialog.

Remember, this is a workaround so it might not work.
Check the comments in the code to know what to change. If it doesn’t work it will display an error for you to know.

let dialog = ...

if (dialog.frm) {
    // Set the doctype name you want to get, the doctype row name
    // and the child table field name you want to get
    dialog.frm.get_value('Doctype Name', 'Row Name', 'Child Table fieldname')
    .then(r => {
        let doc = r.message;
        // loop over your child Table
        $.each(doc.child_table, function(row) {
            // Set the dialog table fieldname
            dialog.frm.add_child('Dialog Table Fieldname', row);
            let table_row = field.grid.add_new_row(null, null, true, null, true);
        // Set the dialog table fieldname
        dialog.frm.refresh_field('Dialog Table Fieldname');
} else {
    frappe.msgprint({ message: __('This workaround does not work.'), title: __('Error'), indicator: 'red' });

you have to do the handling setting the value to individual fields

 page.add_inner_button(__("load child"), function() {
			let dialog = new frappe.ui.Dialog({
				title: __("Load Child"),
				fields: [{
					fieldname: 'fieldname,
					label: __('My xxxy'),
					fieldtype: 'Link',
					options: 'xxx',
					reqd: 1,
					label: __(""),
					fieldname: "",
					fieldtype: "MultiCheck",
					options: [],
					columns: 2,
				primary_action(data) {
						method: "",
						args: {
							data: data
						callback: function (r) {
							if (r.message === 1) {
									message: __("Load child"),
									indicator: 'blue'
				primary_action_label: __('My Chlid')


this should give you feel of what you’re trying to achieve.

Thank you both of @kid1194 and @spryng i will check both of your script .
Thank you.