Yes, this should be working.
You can create your own javascript sorting in the namespace dashGridFunctions
and then use it like this: "comparator": {"function": "myCustomComparator"}
.
I havent tested it yet.
Yes, this should be working.
You can create your own javascript sorting in the namespace dashGridFunctions
and then use it like this: "comparator": {"function": "myCustomComparator"}
.
I havent tested it yet.
Ok i’ll give it a try tomorrow and let you know
Did you see the example of parsing the date in this example?
This valueGetter
parses the date string into a date object, making is so you won’t need a custom date sorting function (in most cases)
columnDefs = [
{
"headerName": "Date",
"filter": "agDateColumnFilter",
"valueGetter": {"function": "d3.timeParse('%d/%m/%Y')(params.data.date)"},
"valueFormatter": {"function": "params.data.date"},
},
]
You can see all the specifiers you can use depending on the format of the datestring in the last example on this page:
You were right. Being so hyped up about all the built-in conversion/formatting directly into the grid, I forgot that I actually needed mimic the part from my code where I convert the dates. thanks
Hi @AnnMarieW and @jinnyzor. Thank for all of your work.
I have a question that is there any way to fit all row in Div like sizeToFit
of columns? As you see it has White Space under dash ag grid.
import dash_ag_grid as dag
from dash import Dash, html, dcc
import requests
import pandas as pd
import json
data = pd.DataFrame({'Category': ['A', 'B', 'C'], 'Value': [1, 2, 3], 'Type': ['Circle','Square','Triangle']})
columnDefs = [{"field": x} for x in data.columns]
app = Dash(__name__)
app.layout = html.Div(
[
dcc.Markdown("This grid has resizeable columns with sort and filter enabled"),
dag.AgGrid(
columnDefs=columnDefs,
rowData=data.to_dict('records'),
columnSize="sizeToFit",
defaultColDef={"resizable": True, "sortable": True, "filter": True},
),
],
style={"margin": 20},
)
if __name__ == "__main__":
app.run_server(debug=False, port=8052)
Sure thing.
A lot of things come native to Dash AG grid from AG grid itself. And all of the props from the grid are available, if not on the first level, then inside dashGridOptions.
Check out here:
They do have a warning that using this can affect the performance, so use it sparingly.
We are continuing to work on the dash-ag-grid component to add new features and improve performance. We don’t expect any more breaking changes, so please feel free to take 2.0.0a4 for a spin!
There are still lots of features that have not yet been documented. Helping translate examples from the official AG Grid docs is a great way to contribute to this project
Here are the latest updates to the docs:
Getting Started section
Rows section
Layout & Style section
Rendering section
Components section
Row Pinning Example
Here is a little more on the Row Pinning. One use case is for adding a total row (when you are using AG Grid community and don’t have the Enterprise aggregation feature) In this example, the average is calculated in a Dash callback and it updates the Averages in the pinned bottom row. Note that the number formatting works automatically, and the totals stay with the columns as you move or resize them:
I haven’t been able to figure out a way just yet for you to be able to do this, it very well could be some additional support that we need to add.
I have this working, their exact example. Problem is that it did take some additional support.