Skip to content

Commit

Permalink
Do not re-render all children when expanding Tabulator row (#7008)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Jul 24, 2024
1 parent 237c8d7 commit 974216c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions panel/models/tabulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type * as p from "@bokehjs/core/properties"
import type {LayoutDOM} from "@bokehjs/models/layouts/layout_dom"
import {ColumnDataSource} from "@bokehjs/models/sources/column_data_source"
import {TableColumn} from "@bokehjs/models/widgets/tables"
import type {UIElementView} from "@bokehjs/models/ui/ui_element"
import type {Attrs} from "@bokehjs/core/types"

import {debounce} from "debounce"
Expand Down Expand Up @@ -705,12 +706,20 @@ export class DataTabulatorView extends HTMLBoxView {

renderChildren(): void {
new Promise(async (resolve: any) => {
await this.build_child_views()
resolve(null)
}).then(() => {
const new_children = await this.build_child_views()
resolve(new_children)
}).then((new_children) => {
for (const r of this.model.expanded) {
const row = this.tabulator.getRow(r)
this._render_row(row, false)
const index = row._row?.data._index
if (this.model.children.get(index) == null) {
continue
}
const model = this.model.children.get(index)
const view = model == null ? null : this._child_views.get(model)
if ((view != null) && (new_children as UIElementView[]).includes(view)) {
this._render_row(row, false)
}
}
this._update_children()
if (this.tabulator.rowManager.renderer != null) {
Expand Down

0 comments on commit 974216c

Please sign in to comment.