From 9d5b4cb150f572466a03594430c1fd6133141832 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Tue, 19 Oct 2021 11:41:12 +0200 Subject: [PATCH 1/2] Ensure Tabulator row content expand button works with frozen columns --- panel/models/tabulator.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/panel/models/tabulator.ts b/panel/models/tabulator.ts index d9dab9ece4..b9ac9e1cc6 100644 --- a/panel/models/tabulator.ts +++ b/panel/models/tabulator.ts @@ -344,7 +344,8 @@ export class DataTabulatorView extends PanelHTMLBoxView { return const style = getComputedStyle(this.tabulator.element.children[1].children[0]) const bg = style.backgroundColor - const row_view = div({style: "height: 100%; width: 100%; background-color: " + bg}) + const neg_margin = "-" + rowEl.style.paddingLeft + const row_view = div({style: "background-color: " + bg +"; margin-left:" + neg_margin }) view.renderTo(row_view) row.getElement().appendChild(row_view) } @@ -389,10 +390,11 @@ export class DataTabulatorView extends PanelHTMLBoxView { columns.push({...column, columns: group_columns}) } else if (column.formatter === "expand") { const expand = { - align: "center", + hozAlign: "center", cellClick: (_: any, cell: any) => { this._update_expand(cell) }, formatter: (cell: any) => { return this._expand_render(cell) }, - width:40 + width:40, + frozen: true } columns.push(expand) } else { From e314c69ba96335f4373aef0a3853297af62fda3e Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Tue, 19 Oct 2021 11:47:46 +0200 Subject: [PATCH 2/2] Fix code formatting --- panel/models/tabulator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panel/models/tabulator.ts b/panel/models/tabulator.ts index b9ac9e1cc6..df12ad60c7 100644 --- a/panel/models/tabulator.ts +++ b/panel/models/tabulator.ts @@ -345,7 +345,7 @@ export class DataTabulatorView extends PanelHTMLBoxView { const style = getComputedStyle(this.tabulator.element.children[1].children[0]) const bg = style.backgroundColor const neg_margin = "-" + rowEl.style.paddingLeft - const row_view = div({style: "background-color: " + bg +"; margin-left:" + neg_margin }) + const row_view = div({style: "background-color: " + bg +"; margin-left:" + neg_margin}) view.renderTo(row_view) row.getElement().appendChild(row_view) } @@ -394,7 +394,7 @@ export class DataTabulatorView extends PanelHTMLBoxView { cellClick: (_: any, cell: any) => { this._update_expand(cell) }, formatter: (cell: any) => { return this._expand_render(cell) }, width:40, - frozen: true + frozen: true } columns.push(expand) } else {