Merge pull request #28955 from vishakhdesai/fix-idx-pagination
fix: update idx and name in table before rendering result rows
This commit is contained in:
commit
562f8212ec
1 changed files with 12 additions and 0 deletions
|
|
@ -203,6 +203,7 @@ 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");
|
||||
|
|
@ -225,6 +226,17 @@ 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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue