Hello there…
how to add custom button into child table row…??
i try set button into value but it’s doesnt work
frappe.ui.form.on("Organisasi",{
"organitation_name": function(frm, cdt, cdn) {
var d = locals[cdt][cdn];
var comunity_name = frm.doc.organitation_name[2].organitation_name.split('-')[0]
var city = frm.doc.organitation_name[2].organitation_name.split('-')[1].replace(/\s/g, '');
var post_data = {'comunity_name': comunity_name, 'city': city};
var json_data = JSON.stringify( post_data );
$.ajax({
type: 'POST',
url: '/get_komunitas1',
data: json_data,
success: function(datai){
frappe.model.set_value(cdt, cdn, "status", "not connect");
frappe.model.set_value(cdt, cdn, "comunity_location", datai.message['city']);
if(datai.message['kode_komunitas'] == 'KUM'){
frappe.model.set_value(cdt, cdn, "comunity_type", "Komunitas");
}
frappe.model.set_value(cdt, cdn, "actions", set_button(frm));
frm.refresh_field("actions");
}
});
}
});
var set_button = function(frm){
return cur_frm.add_custom_button(“connect”, function(){
var post_data =
{
"kode": v['kode'],
"comunity_name": v['comunity_name']
}
$.ajax({
type: 'POST',
url: '/remove_member',
data: post_data,
success: function(datai){
console.log(datai)
},
error: function(datai){
console.log('error log', datai)
return false;
}
});
});
}