Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static configuration not working on Tabulator object when created from param #4933

Open
mayonnaisecolouredbenz7 opened this issue May 25, 2023 · 2 comments
Labels
component: tabulator Related to the Tabulator widget type: bug Something isn't correct or isn't working
Milestone

Comments

@mayonnaisecolouredbenz7
Copy link
Contributor

ALL software version info

panel 1.0.2
param 1.13.0
holoviews 1.16.0
tornado 6.2
pyviz-comms 2.2.1

Description of expected behavior and the observed behavior

Attempting to disable header sort. It works when creating a tabulator object normally as is shown in the documentation.
https://panel.holoviz.org/reference/widgets/Tabulator.html#static-configuration
Does not seem to work when created from a param object.

Complete, minimal, self-contained example code that reproduces the issue

Does not work:

import pandas as pd
import panel as pn
import param
pn.extension('tabulator')

class TestClass(param.Parameterized):
    df = pd.DataFrame({
    'int': [1, 2, 3],
    'float': [3.14, 6.28, 9.42],
        }, index=[1, 2, 3])
    
    param_df=param.DataFrame(df)

c=TestClass()

pn.widgets.Tabulator.from_param(c.param.param_df,configuration={
    'columnDefaults': {
        'headerSort': False,
    },})

Works:

df = pd.DataFrame({
    'int': [1, 2, 3],
    'float': [3.14, 6.28, 9.42],
}, index=[1, 2, 3])


pn.widgets.Tabulator(df,configuration={
    'columnDefaults': {
        'headerSort': False,
    },})

Stack traceback and/or browser JavaScript console output

None

Screenshots or screencasts of the bug in action

Param:
image
Non Param:
image

@philippjfr
Copy link
Member

Seems like configuration is not implemented as a parameter of Tabulator right now. Due to the special handling Param doesn't recognize configuration and simply drops it. As I'm releasing 1.0.3 shortly I don't want to mess this deeply with Tabulator before the release but I may get a warning about the parameter being dropped in.

@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label May 25, 2023
@philippjfr philippjfr modified the milestones: v1.0.4, v1.0.5 May 25, 2023
@philippjfr philippjfr modified the milestones: v1.0.5, v1.1.0, v1.1.1 Jun 5, 2023
@philippjfr philippjfr modified the milestones: v1.1.1, v1.2.0 Jun 22, 2023
@philippjfr philippjfr modified the milestones: v1.2.0, v1.2.1 Jul 10, 2023
@philippjfr philippjfr modified the milestones: v1.2.1, v1.2.2 Jul 25, 2023
@mayonnaisecolouredbenz7
Copy link
Contributor Author

Work around that has worked for me in the mean time:

tab_obj = pn.widgets.Tabulator.from_param(...)
tab_obj._configuration["columnDefaults"] = {"headerSort": False}

@hoxbro hoxbro modified the milestones: v1.2.2, v1.2.3 Sep 4, 2023
@philippjfr philippjfr modified the milestones: v1.2.3, v1.2.4 Sep 18, 2023
@philippjfr philippjfr modified the milestones: v1.2.4, v1.3.0 Oct 9, 2023
@philippjfr philippjfr modified the milestones: v1.3.0, v1.3.1 Oct 23, 2023
@philippjfr philippjfr modified the milestones: v1.3.1, v1.3.2 Oct 31, 2023
@maximlt maximlt added the component: tabulator Related to the Tabulator widget label Nov 14, 2023
@philippjfr philippjfr removed this from the v1.3.2 milestone Nov 22, 2023
@philippjfr philippjfr added this to the v1.4.0 milestone Nov 22, 2023
@philippjfr philippjfr modified the milestones: v1.4.0, v1.4.x Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tabulator Related to the Tabulator widget type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

4 participants