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

Updated fullscreen to allow for filtering and searching #452

Merged
merged 3 commits into from
Aug 16, 2024
Merged
Changes from 1 commit
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
9 changes: 5 additions & 4 deletions src/frontend/components/data-table/lib/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ class DataTableComponent extends Component {

// Self reference included due to scoping
addSearchDropdown(column, id, index) {
console.log("Adding search dropdown");
droberts-ctrlo marked this conversation as resolved.
Show resolved Hide resolved
const $header = $(column.header())
const title = $header.text().trim()
const searchValue = column.search()
Expand Down Expand Up @@ -615,7 +616,7 @@ class DataTableComponent extends Component {

this.json = json || undefined

if (this.initializingTable) {
if (this.initializingTable || conf.reinitialize) {
dataTable.columns().every(function(index) {
const column = this
const $header = $(column.header())
Expand Down Expand Up @@ -721,10 +722,10 @@ class DataTableComponent extends Component {

// Move data table into new modal
newModal.append(table);
document.body.appendChild(newModal);
if(currentTable && !($.fn.dataTable.isDataTable(currentTable))) {
currentTable.DataTable(this.getConf({responsive: false}));
currentTable.DataTable(this.getConf({responsive: false, reinitialize: true}));
}
document.body.appendChild(newModal);

$(document).on("keyup", (ev)=>{
if(ev.key === "Escape") {
Expand All @@ -741,7 +742,7 @@ class DataTableComponent extends Component {

mainContent.appendChild(table);
if(currentTable && !($.fn.dataTable.isDataTable(currentTable))) {
currentTable.DataTable(this.getConf());
currentTable.DataTable(this.getConf({reinitialize: true}));
}
// Remove the modal
document.querySelector('#table-modal').remove();
Expand Down
Loading