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 searchBuilder option for Data Tables #292

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ theme_variables:
# edit_me: true
# open_issue: true
# history: true
# datatables:
# searchbuilder: False
# headings:
# related-pages: Related pages
# more-information-tiles: More information
Expand Down
10 changes: 10 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,23 @@
<link rel="stylesheet" type="text/css" href="{{ 'assets/css/dataTables.bootstrap5.min.css' | relative_url }}">
<script type="text/javascript" charset="utf8" src="{{ 'assets/js/jquery.dataTables.min.js' | relative_url }}"></script>
<script type="text/javascript" charset="utf8" src="{{ 'assets/js/dataTables.bootstrap5.min.js' | relative_url }}"></script>
{%- if site.theme_variables.datatables.searchbuilder %}
<link rel="stylesheet" type="text/css" href="{{ 'assets/css/searchBuilder.bootstrap5.min.css' | relative_url }}">
<script type="text/javascript" charset="utf8" src="{{ 'assets/js/dataTables.searchBuilder.min.js' | relative_url }}"></script>
<script type="text/javascript" charset="utf8" src="{{ 'assets/js/searchBuilder.bootstrap5.min.js' | relative_url }}"></script>
{%- endif %}
<script type="text/javascript">
$(document).ready(function () {
$('table.display').each(function() {
$(this).DataTable({
lengthMenu: [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
stateSave: true,
searching: true,
{%- if site.theme_variables.datatables.searchbuilder %}
layout: {
topStart: 'searchBuilder'
},
{%- endif %}
info: true,
pageLength: 10,
language: {
Expand Down
1 change: 1 addition & 0 deletions assets/css/searchBuilder.bootstrap5.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions assets/js/dataTables.searchBuilder.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions assets/js/searchBuilder.bootstrap5.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pages/documentation/configuring_theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ theme_variables:
edit_me: true
open_issue: true
history: true
datatables:
searchbuilder: False
headings:
related-pages: Related pages
more-information-tiles: More information
Expand Down Expand Up @@ -83,6 +85,8 @@ More detailed information about these settings can be found here:
* `edit_me`: Enable the 'propose an edit on this page' button.
* `open_issue`: Enable the 'open an issue on this page' button.
* `history`: Enable the 'history of this page' button.
* **datatables**: Settings related to the DataTables JS library
* `searchbuilder`: SearchBuilder provides the end user with an easy to use UI for them to create their own complex custom search expression for a DataTable. Default: False.
* **headings**: Change the subtitles or collapse the page sections that are automatically generated
`related-pages`: Default: Related pages
`more-information-tiles`: Default: More information
Expand Down
Loading