Skip to content

Commit

Permalink
refactor: render list progressively
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Feb 26, 2024
1 parent 898f982 commit 7781f43
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions frappe/public/js/frappe/list/list_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,16 +604,14 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
render_list() {
// clear rows
this.$result.find(".list-row-container").remove();

if (this.data.length > 0) {
// append rows
this.$result.append(
this.data
.map((doc, i) => {
doc._idx = i;
return this.get_list_row_html(doc);
})
.join("")
);
let idx = 0;
for (let doc of this.data) {
doc._idx = idx++;
this.$result.append(this.get_list_row_html(doc));
}
}
}

Expand Down

0 comments on commit 7781f43

Please sign in to comment.