Dear All,
i wanted to implement, nested TABLE’s in erpnext, could anyone guide me ,
i want to access the “doc” in the following method. but, if you notice we are getting the doc from the this.frm.doc, is there a way to pass the current open table doc in the Grid ?? instead of this.frm.doc
Please help. Thanks.
add_new_row: function(idx, callback, show) {
if(this.is_editable()) {
// instead of this.frm.doc, i want to pass the current parent doc.
var d = wn.model.add_child(this.frm.doc, this.df.options, this.df.fieldname, idx);
this.frm.script_manager.trigger(this.df.fieldname + "_add", d.doctype, d.name);
this.refresh();
if(show) {
if(idx) {
this.wrapper.find("[data-idx='"+idx+"']").data("grid_row")
.toggle_view(true, callback);
} else {
this.wrapper.find(".grid-row:last").data("grid_row").toggle_view(true, callback);
}
}
this.frm.script_manager.trigger(this.df.fieldname + "_post_render", d.doctype, d.name);
return d;
}
},