Merge pull request #28053 from akhilnarang/fix-grid-issues

fix: grid issues in web forms
This commit is contained in:
Akhil Narang 2024-10-09 14:33:16 +05:30 committed by GitHub
commit 7e8290b05f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 13 deletions

View file

@ -123,7 +123,6 @@ export default class Grid {
this.setup_add_row();
this.setup_grid_pagination();
this.update_idx_and_name();
this.custom_buttons = {};
this.grid_buttons = this.wrapper.find(".grid-buttons");
@ -146,17 +145,6 @@ export default class Grid {
}
}
update_idx_and_name() {
this.data.forEach((d, ri) => {
if (d.idx === undefined) {
d.idx = ri + 1;
}
if (d.name === undefined) {
d.name = "row " + d.idx;
}
});
}
set_doc_url() {
let unsupported_fieldtypes = frappe.model.no_value_type.filter(
(x) => frappe.model.table_fields.indexOf(x) === -1
@ -478,6 +466,12 @@ export default class Grid {
if (!d) {
return;
}
if (d.idx === undefined) {
d.idx = ri + 1;
}
if (d.name === undefined) {
d.name = "row " + d.idx;
}
let grid_row;
if (this.grid_rows[ri] && !append_row) {
grid_row = this.grid_rows[ri];

View file

@ -688,7 +688,6 @@ export default class GridRow {
this.grid.visible_columns.forEach((col, ci) => {
// to get update df for the row
let df = fields.find((field) => field?.fieldname === col[0].fieldname);
if (!df) return;
this.set_dependant_property(df);