Merge pull request #13926 from rohitwaghchaure/fixed-grid-performance-issue

perf: Grid rendering
This commit is contained in:
mergify[bot] 2021-08-13 06:08:13 +00:00 committed by GitHub
commit c6f1f91668
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,6 +37,8 @@ export default class Grid {
}
this.is_grid = true;
this.debounced_refresh = this.refresh.bind(this);
this.debounced_refresh = frappe.utils.debounce(this.debounced_refresh, 500);
}
allow_on_grid_editing() {
@ -675,6 +677,7 @@ export default class Grid {
if (!idx) {
idx = this.grid_rows.length - 1;
}
setTimeout(() => {
this.grid_rows[idx].row
.find('input[type="Text"],textarea,select').filter(':visible:first').focus();
@ -934,6 +937,6 @@ export default class Grid {
// update the parent too (for new rows)
this.docfields.find(d => d.fieldname === fieldname)[property] = value;
this.refresh();
this.debounced_refresh();
}
}