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

Delete button disappears upon use of page_action setting #3075

Open
CoranH opened this issue Nov 14, 2024 · 1 comment
Open

Delete button disappears upon use of page_action setting #3075

CoranH opened this issue Nov 14, 2024 · 1 comment
Labels
bug something broken P2 considered for next cycle

Comments

@CoranH
Copy link

CoranH commented Nov 14, 2024

page_action being set disables the column deletable functionality (no icon/button).
Minimal modified example from the docs:

from dash import Dash, dash_table, dcc, html, Input, Output, State, callback

app = Dash(__name__)

app.layout = html.Div([
    html.Div([
    dash_table.DataTable(
        id='editing-columns',
        columns=[{
            'name': 'Column {}'.format(i),
            'id': 'column-{}'.format(i),
            'deletable': True,
            'renamable': True
        } for i in range(1, 5)],
        data=[
            {'column-{}'.format(i): (j + (i-1)*5) for i in range(1, 5)}
            for j in range(5)
        ],
        page_action='custom',
        editable=True
        )])
    ])

if __name__ == '__main__':
    app.run(debug=True)
  • replace the result of pip list | grep dash below
dash                      2.18.2
dash-bootstrap-components 1.6.0
dash-core-components      2.0.0
dash-html-components      2.0.0
dash-table                5.0.0

  • if frontend related, tell us your Browser, Version and OS
    • Windows 11 Enterprise (23H2, 22631.4460)
    • Chrome (130.0.6723.117)

Describe the bug

When I copy the example for a column deletable datatable, the moment I add the "page_action" (set to 'custom') argument to the data-table ctor, the delete icon/button disappears. It is the same issue described here: plotly/dash-table#511

Expected behavior

Delete icon to be visible/actionable with a page_action (to allow backend paging) also set.
I don't know if this is intended but undocumented, if the user is expected to implement any data altering effects in the backend first.

@gvwilson gvwilson changed the title [BUG] Delete button disappears upon use of page_action setting Delete button disappears upon use of page_action setting Nov 15, 2024
@gvwilson gvwilson added bug something broken P2 considered for next cycle labels Nov 15, 2024
@2Ryan09
Copy link

2Ryan09 commented Jan 19, 2025

This appears to be a deliberate decision made by the dash team. Link.

Manually removing that flag, it results in an invalid prop combination as specified by validFSP

As to exact reasoning for these validations, is beyond my codebase-reading comprehension atm. I can only speculate that the use of page_action="custom" results in certain actions requiring you to write your own callbacks to handle their implementation (delete being one of them).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P2 considered for next cycle
Projects
None yet
Development

No branches or pull requests

4 participants
@gvwilson @CoranH @2Ryan09 and others