Comments (5)
@charleyferrari You need to set type='dropdown' on the column, default is 'text', the column_static_dropdown will not override the type behavior
from dash-table.
@charleyferrari can you edit your example and see if that resolves the issue you're seeing?
from dash-table.
@Marc-Andre-Rivet @cldougl hmm... still not working for me.
Here's what I have:
import dash
from dash.dependencies import Input, Output, State
import dash_html_components as html
import dash_table
import pandas as pd
collist = ['one', 'two', 'three', 'category']
categories = ['Great', 'Good', 'Fair', 'Poor']
df = pd.DataFrame({i: [1, 2, 3, 4] if i != 'category'
else ['Great', 'Good', 'Poor', 'Fair']
for idx, i in enumerate(collist)})
df = df[collist]
df = df.values
app = dash.Dash()
app.css.config.serve_locally = True
app.scripts.config.serve_locally = True
app.layout = html.Div([
dash_table.Table(
id='table',
dataframe=df,
columns=[{'id': idx, 'name': i} if i != 'category'
else {'id': idx, 'name': i, 'type': 'dropdown'}
for idx, i in enumerate(collist)],
editable=True,
row_deletable=True,
sorting=True,
# Toggling this
n_fixed_rows=1,
column_static_dropdown=[{
'id': 'bbb',
'dropdown': [{'label': i, 'value': i} for i in categories]
}],
row_selectable='single'
)
])
@app.callback(
Output('table', 'dataframe'),
[Input('table', 'dataframe_timestamp')],
[State('table', 'dataframe')]
)
def table_it(df_ts, df):
print('called it')
return df
if __name__ == '__main__':
app.run_server(debug=True)
The only change being columns = [...
, where I added the dropdown key for category.
I'll continue troubleshooting to make sure I'm not missing something.
from dash-table.
@charleyferrari As discussed outside this thread, column_static_dropdown 'id' needs to match the column ids above.
from dash-table.
@Marc-Andre-Rivet Thanks, it's working for me, so this can be closed out.
from dash-table.
Related Issues (20)
- Filter datatable based on absolute value HOT 1
- option to remove case sensitivity icon HOT 1
- [BUG] Virtualized table breaks when clicking further down than initial view if filter query conditional data style is present HOT 4
- Case-insensitive filter causes "Cannot read property 'toString' of null" exception when the column contains null value HOT 1
- [BUG] Prop `data_previous` isn't correctly updated with copy+paste
- Python backend sorting and filtering while keeping row selections functionality HOT 2
- 0 or null value in filter result breaks DataTable with fixed_rows and fixed_columns
- after backend filtering the exported data contains only 10 records
- Feature Request: make checkbox (row_selectable) available only for specific (conditional) rows HOT 1
- Conditional column alignment not applied to headers
- Save input text in Input field inside Dash Editable Datatable without pressing 'Enter' key? HOT 3
- Copy selected value in Dropdown inside Dash Editable Datatable?
- Can not read properties of undefined 'X'
- Paste does not work on columns with editable equals true
- Include option rowReorder HOT 2
- fixed_columns causes issues with header alignment and overflowx
- Drag behavior for text being dragged into datatable is incomplete/odd
- Dash & XLwings. Attempting to pre-load Excel before Dash callback to save load time. HOT 1
- Dropdown won't display
- please I need a feature that dragging to selecting range on datatable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dash-table.