mwouts / itables

Pandas DataFrames as Interactive DataTables
https://mwouts.github.io/itables/
MIT License
776 stars 57 forks source link

Support passing custom dt_args into DataTable() #52

Closed jklap closed 2 years ago

jklap commented 2 years ago

Currently it's hardcoded to only pass in "data" but would be create if that could be customized in some way

mwouts commented 2 years ago

Hi @jklap , well in the template the dt_args are empty, but that is just a template. In practice we replace that with the arguments passed by the user: https://github.com/mwouts/itables/blob/6a194090c010fcae44e184da06866cad665513a4/itables/javascript.py#L188-L190

That means that you can pass to the show function, or to itables.options, any argument that you wish to see in the dt_args.

Is that what you were looking for?

(Examples are available in the README)

jklap commented 2 years ago

Yep-- that looks great. Didn't realize the second arg passed to show() was passing directly to DataTable(). Thanks!

mwouts commented 2 years ago

Thanks @jklap . Also feel free to open a PR if you think we can state this more clearly in the README.