Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

editable_name showing controls but not changing column names #255

Closed
eliasdabbas opened this issue Nov 28, 2018 · 5 comments
Closed

editable_name showing controls but not changing column names #255

eliasdabbas opened this issue Nov 28, 2018 · 5 comments
Labels
dash-type-bug Something isn't working as intended

Comments

@eliasdabbas
Copy link

Passing editable_name: True in the columns dict seems to show the pencils, clicking on the pencils also shows the prompt, but does not actually change the column name.

I also tried passing a number for this parameter, and in this case no pencils appeared next to column names:

screen shot 2018-11-28 at 4 11 37 am

My code for the above tables:

import dash
import pandas as pd
import dash_html_components as html
from dash_table import DataTable


df = pd.DataFrame({
    'one': [1, 2, 3],
    'two': [2, 3, 4],
    'three': [3, 4, 5]
})

app = dash.Dash(__name__)

app.layout = html.Div([
    DataTable(columns=[{'name': c, 'id': c, 'editable_name':True}
                        for c in df.columns],
              data=df.to_dict('rows')),

    DataTable(columns=[{'name': c, 'id': c, 'editable_name': 2}
                       for c in df.columns],
              data=df.to_dict('rows'))
])


if __name__ == '__main__':
    app.run_server(debug=True)

Packages:

dash==0.30.0
dash-core-components==0.38.1
dash-html-components==0.13.2
dash-renderer==0.15.1
dash-table==3.1.7

I'm using a Mac and tried the above on Chrome, Safari, and Firefox.

@Marc-Andre-Rivet
Copy link
Contributor

I suspect this issue is related to the same overarching issue causing #202 -- if no callback is defined on the table properties do not update as expected.

For editable_name: 2 this is because there is only 1 line in the header, if you change the value for 0 it will show the pen. The number is useful in order do define which rows can be edited in a multiline header. With true all header lines would be editable.

For example:

    dash_table.DataTable(columns=[{'name': [c, c + '-low', c + '-lower', c + '-lowest'], 'id': c, 'editable_name': idx }
                       for idx, c in enumerate(df.columns)],
              data=df.to_dict('rows'))

issue255

@Marc-Andre-Rivet Marc-Andre-Rivet added dash-type-bug Something isn't working as intended Attribute: Functionality labels Nov 28, 2018
@eliasdabbas
Copy link
Author

Got it. I didn't know the number referred to a row. I though it referred to which columns were editable. Thanks for clarifying.

@Marc-Andre-Rivet
Copy link
Contributor

@eliasdabbas Looking at this again, I am unable to reproduce the issue on the latest version of the table / dash / dash-renderer with the example code above.

Can you confirm if this is still an issue for you? Thanks!

@eliasdabbas
Copy link
Author

Perfect!
I upgraded, and tried again, and it's working fine on my side.
Thanks!

@Marc-Andre-Rivet
Copy link
Contributor

Closing as this is fixed in v3.1.8

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dash-type-bug Something isn't working as intended
Projects
None yet
Development

No branches or pull requests

2 participants