Skip to content
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

Add support for custom DataTables options #308

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

mrharpo
Copy link
Contributor

@mrharpo mrharpo commented Sep 25, 2023

Datatable options

Adds datatables_options: Dict for BaseModelView.

Values will overwrite default values for datatable set in list.js

e.g:

datatables_options = {
    'dom': "r<'card-header d-flex align-items-center'<'m-0'i><'m-0 ms-auto'p>><'table-responsive't>",
    'pagingType': 'bootstrap_input',
    'keys': {'clipboardOrthogonal': 'export'},
    'fixedHeader': True,
}

Closes #305

@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (fb62f16) 100.00% compared to head (6b942d5) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #308   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           68        68           
  Lines         4965      4966    +1     
=========================================
+ Hits          4965      4966    +1     
Files Coverage Δ
starlette_admin/views.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jowilf jowilf merged commit e351ddc into jowilf:main Sep 26, 2023
7 checks passed
@jowilf
Copy link
Owner

jowilf commented Sep 26, 2023

Thank you for your contribution! 🎉

mrharpo added a commit to WGBH-MLA/starlette-admin that referenced this pull request Sep 27, 2023
* main:
  🏓 Datatables options (jowilf#308)
@jowilf jowilf added this to the 0.12.0 milestone Oct 10, 2023
mrharpo added a commit to WGBH-MLA/starlette-admin that referenced this pull request Oct 10, 2023
* main:
  Update sqlalchemy-file requirement from <0.6.0,>=0.5.0 to >=0.5.0,<0.7.0 (jowilf#326)
  🎬 Detail actions (jowilf#302)
  [pre-commit.ci] pre-commit autoupdate (jowilf#293)
  Bump fasteners from 0.18 to 0.19 (jowilf#322)
  Update httpx requirement from <0.25.0,>=0.23.3 to >=0.23.3,<0.26.0 (jowilf#314)
  Skip odmantic Test Suite on Python 3.8 Due to Segment Fault and Lack of Maintenance (jowilf#325)
  Bump ruff from 0.0.286 to 0.0.292 (jowilf#323)
  Update mkdocstrings[python] requirement (jowilf#315)
  Update arrow requirement from <1.3.0,>=1.2.3 to >=1.2.3,<1.4.0 (jowilf#316)
  Bump black from 23.7.0 to 23.9.1 (jowilf#317)
  Bump actions/checkout from 3 to 4 (jowilf#318)
  🏓 Datatables options (jowilf#308)
@jowilf jowilf changed the title 🏓 Datatables options Add support for custom datatables options Nov 1, 2023
@jowilf jowilf changed the title Add support for custom datatables options Add support for custom DataTables options Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Datatables dom configuration
2 participants