Tabulator with spreadshet clipboard function

Hi All,

is it possible tabulator in panel have clipboard function as per tabulator js doumentation here:

https://tabulator.info/examples/6.3#spreadsheet-clipboard

kindly please advise how to implement it in panel. If not possible is that any editor beside tabulator that can be used in panel.

thanks

There is a request for it in Support copy and paste in Tabulator · Issue #4632 · holoviz/panel.

For now you might be able to use panel-copy-paste: Extends HoloViz Panel with functionality to copy to and paste from the clipboard. That is what I do.

panel-copy-paste

Thanks @Marc . Awesome. will try but will update my python first so can able install the library.

thank you

1 Like

Hi @Marc ,

besides install the package, is there any requirement package to be updated? (panel or bokeh?) since I just install panel-copy-paste and run in my enviro look like it doesn’t work, however when I try using your example from live demo web(PyCafe - Panel - A refererence app for the panel-copy-paste Python package), it works. I am wondering if there is specific setup or requirement needed so I can replicate that.

Kindly please advise.

thanks

1 Like

I’m using latest version of panel==1.5.4 on python 3.11. The pipelines test python>=3.11.

I know its currently not working in Jupyter. But its a general problem I believe JSComponent not working in Jupyter · Issue #7517 · holoviz/panel.

Hi @Marc
thanks for your advice. I use the same version with you and test with the following code in my system:
image
code:

import panel as pn
from panel_copy_paste import PasteButton,PasteToDataFrameButton

pn.extension("codeeditor","tabulator")
pn.extension("tabulator")

table = pn.widgets.Tabulator()
button1 = PasteToDataFrameButton(target=table)

layout1=pn.Column("**paste to tabulator**",button1, table)

editor = pn.widgets.CodeEditor()
button = PasteButton(target=editor)
layout2=pn.Column("**paste to editor**",button, editor)

pn.template.FastListTemplate(
    title="panel-copy-paste",
    main=[layout1, layout2],
    main_layout=None,
).servable()

result:

input data:
image

from pycafe:

from this exercise I got:

  1. button for paste is not working both to tabulator and editor
  2. I can paste to editor directly using mouse or using keyboard (ctrl-v) but not with button
  3. paste to dataframe to tabulator seem not working whether from mouse/keyboard or from button
  4. using pycafe demo looks like work as expected

Kindly please advice if need to have special tabulator version.
Note previously tabulator not installed in my enviro but there is no error occur, probably for the next version need to add error if that library need.

thank you

1 Like

Hi @rh1

I tried your code and it works for me.

I’m using python 3.11, panel 1.5.4 and panel-copy-paste 0.0.4.

Do you see any errors in the browser console?

Hi @Marc ,
thank you for your advice. I got error in console with this error:
For copy


 Uncaught TypeError: Cannot read properties of undefined (reading 'writeText')

For paste

Uncaught TypeError: Cannot read properties of undefined (reading 'readText')

Kindly please advise. Thank you

Hi @Marc ,

I suspect the problem because I run server in non https , is it any clue to make panel serve server become secure or using https.

thanks

Hi @Marc

I solve the problem with make server become secure server so your tools is work as expected.

serve panel as secure web:
–ssl-certfile CERTFILE Absolute path to a certificate file for SSL termination
–ssl-keyfile KEYFILE Absolute path to a private key file for SSL termination

thank you

2 Likes

Thx for sharing @rh1

1 Like