Tabulator Widget Dynamic Visibility On Value Change

Hello all,
First, thanks for creating Holoviz!

I want to change a Tabulator value, when it is not visible.
When visible switched on, i would like to see the new Tabulator value.

Tabulator value changes, when visible switched on, Tabulator content is not showed up.

Actions to reproduce:

  1. Click Show/Hide button.
  2. Click Change Value button.
  3. Click Show/Hide button again.

Code snippet to reproduce:
import sys
import panel as pn
import pandas as pd
tab = pn.widgets.Tabulator(pd.DataFrame(columns=[‘x’], data=[1, 2, 3], index=[0, 1, 2]))

def btn1_event(e):
tab.value = pd.DataFrame(columns=[‘x’], data=[3, 4], index=[0, 1])
print(f’\nChanged value to\n{tab.value}')

btn1 = pn.widgets.Button(name=‘Change Value’, on_click=btn1_event)

def btn2_event(e):
val = not bool(e.cls.clicks % 2)
tab.visible = val
print(f’\nJust changed visibility to {val}\ntab value is \n{tab.value}')

btn2 = pn.widgets.Button(name=‘Show/Hide’, on_click=btn2_event)

terminal = pn.widgets.Terminal()
sys.stdout = terminal

pn.Row(tab, btn1, btn2, terminal).show()

Panel Version


Any Ideas ?