Merge pull request #13483 from surajshetty3416/fix-grid-delete-all

fix: Grid delete all should trigger form change
This commit is contained in:
Suraj Shetty 2021-06-14 09:41:48 +05:30 committed by GitHub
commit c299dead5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -210,9 +210,9 @@ export default class Grid {
delete_all_rows() {
frappe.confirm(__("Are you sure you want to delete all rows?"), () => {
this.frm.doc[this.df.fieldname] = [];
$(this.parent).find('.rows').empty();
this.grid_rows = [];
this.grid_rows.forEach(row => {
row.remove();
});
this.frm.script_manager.trigger(this.df.fieldname + "_delete", this.doctype);
this.wrapper.find('.grid-heading-row .grid-row-check:checked:first').prop('checked', 0);