What is on select row child function?

I want to write some logic on selecting row of table on editable state or not

How I can do that?

Can you given an example?

I do it with this code but it is not neat

frappe.ui.form.on('Doctype', {
    refresh: function(frm) {
        var x = $(frm.get_field("grid1"));
        setTimeout(function() {
            var grid = x[0].grid;
            for (var g in grid.grid_rows) {
                if (grid.grid_rows.hasOwnProperty(g)) {
                    var me = this;
                    $(grid.grid_rows[g].wrapper[0]).on('click', function() {
                        var $this = $(this);
                        var $row = $($this[0].children[0].children[1].children[1]);
                        table = $row[0].innerText
                        //get the value of selected row and do some logic
                        console.log("grid1 = ", table);
                    });
                }
            }
        }, 500);
    }
});

what I want to achieve is like master slave table , on select or clicked the master table the slave table get reflected

@rmehta
Any help please

I think it’s really unclear what you are trying to do…

@Ben_Cornwell_Mott I want to trigger function wehn selecting a row

@Mohammed_Redha could you solve

See this may help you