Update field value of table on row added

i am trying to capture event when row is added to table and successfully captured event using below code.
frappe.ui.form.on(‘Employee Child Table’, {
employee_add: function(frm) {
frappe.call({
“method”: “attendance.attendance.doctype.employee_details.employee_details.generate_code”,
callback:function(r){
console.log(r.message)
cur_frm.employee.set_value(“employee”,"EMP - "+(parseInt(r.message)+1));}

});
}
});

so,i want to update employee id field for every row automatically as soon as row is added. any idea on how to achieve this.any help will be more helpful.

Is it not happening on callback?
What do you get in r.message?

Example here:

@KanchanChauhan i m successfully getting row count but how to set it in table field.

@umair i have to update field in table itself.