You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
@app.callback(
Output('editing-columns', 'columns'),
Input('editing-columns', 'columns'),
State('editing-columns', 'data')
)
def handle_column_deletion(updated_columns, data):
"""
This callback ensures the columns remain deletable even with custom paging.
"""
for col in updated_columns:
col['deletable'] = True # Re-enable the delete icon
col['renamable'] = True # Ensure renaming is also preserved
return updated_columns
@app.callback(
Output('editing-columns', 'data'),
[Input('editing-columns', 'page_current'),
Input('editing-columns', 'page_size')]
)
def update_data(page_current, page_size):
"""
Handles custom paging to show only the current page of data.
"""
start = page_current * page_size
end = start + page_size
return initial_data[start:end] # Return paginated data
page_action being set disables the column deletable functionality (no icon/button).
Minimal modified example from the docs:
pip list | grep dash
belowDescribe 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.
The text was updated successfully, but these errors were encountered: