Merge pull request #25066 from barredterra/progressive-list-render

refactor: render list progressively
This commit is contained in:
Ankush Menat 2024-02-26 20:12:09 +05:30 committed by GitHub
commit 1b4fe29da2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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));
}
}
}