-
Notifications
You must be signed in to change notification settings - Fork 23
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
Customized GroupBy #14
Comments
Hi @pjaol ! Can you help me with this, please? |
It shouldn't be too difficult to add PR #11 added the ability to register JS functionality for column formatters |
@xanderwallace85 I've just added Javascript resolution to dash-tabulator options, so if you update it will now be available Ensure you have
Create your custom groupBy function in your assets folder based on http://tabulator.info/docs/4.8/group window.myNamespace = Object.assign({}, window.myNamespace, {
tabulator: {
groupByGenderAge:function(data, table){
//data - the data object for the row being grouped
// table - the tabulator table object
return data.gender + " - " + data.age; //groups by data and age
}
}
}); Within your python code add dash_extensions javascript Namespace and register your custom namespace from dash_extensions.javascript import Namespace
...
ns = Namespace("myNamespace", "tabulator") Then as you setup your options options = { "groupBy": ns("groupByGenderAge", "selectable":"true, .....} |
Hi @pjaol ! I have just seen your replies (for some reason I haven't received any notifications :S). Thank you so so much for your precious help! I will follow your suggestion :) |
Hi @pjaol ! Have you tried this? I get an error :(
|
Maybe missing a ')'
|
Hi there, did you manage to send the data back to the backend? I have a similar problem. https://community.plotly.com/t/dash-tabulator-get-current-sorting/48819 Cheers |
To send data back to python in the JS function use table.props.setProps({"dataSorted": xxx}) That then make it an input in your python code @app.callback(
[....], # outputs
[Input('table-id', 'dataSorted') ]
)
def doStuff(dataSorted) :
.... |
Hi!
does the library support also customized grouping functions as in the tabulator JS? Or only column names?
The text was updated successfully, but these errors were encountered: