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

fix: '-' in Html(Data)Table Ids prevent using modal windows #1743

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions adm_program/system/classes/HtmlDataTables.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ public function createJavascript(int $rowCount = 0, int $columnCount = 0)
$javascriptGroupFunction = '
// Order by the grouping
$("#' . $this->id . ' tbody").on("click", "tr.admidio-group-heading", function() {
const currentOrder = admidioTable_'. $this->id . '.order()[0];
const currentOrder = admidioTable_' . $this->id . '.order()[0];
if (currentOrder[0] === ' . $this->groupedColumn . ' && currentOrder[1] === "asc") {
admidioTable_'. $this->id . '.order([' . $this->groupedColumn . ', "desc"]).draw();
admidioTable_' . $this->id . '.order([' . $this->groupedColumn . ', "desc"]).draw();
} else {
admidioTable_'. $this->id . '.order([' . $this->groupedColumn . ', "asc"]).draw();
admidioTable_' . $this->id . '.order([' . $this->groupedColumn . ', "asc"]).draw();
}
});';
}
Expand All @@ -197,7 +197,7 @@ public function createJavascript(int $rowCount = 0, int $columnCount = 0)
}
$this->htmlPage->addJavascript(
'
const admidioTable_'. $this->id . ' = $("#' . $this->id . '").DataTable({' .
const admidioTable_' . $this->id . ' = $("#' . $this->id . '").DataTable({' .
implode(',', $this->datatablesInitParameters) .
$javascriptGroup . '
});
Expand Down
2 changes: 1 addition & 1 deletion adm_program/system/classes/ModuleDocumentsFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function createContentList()
}

// initialize and set the parameter for DataTables
$dataTables = new HtmlDataTables($this, 'documents-files-table');
$dataTables = new HtmlDataTables($this, 'documents_files_table');
MightyMCoder marked this conversation as resolved.
Show resolved Hide resolved
$dataTables->disableDatatablesColumnsSort(array(1, 6));
$dataTables->setDatatablesColumnsNotHideResponsive(array(6));
$dataTables->createJavascript(count($this->data), 6);
Expand Down
2 changes: 1 addition & 1 deletion adm_program/system/classes/ModuleGroupsRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public function createContentPermissionsList()
}

// initialize and set the parameter for DataTables
$dataTables = new HtmlDataTables($this, 'role-permissions-table');
$dataTables = new HtmlDataTables($this, 'role_permissions_table');
MightyMCoder marked this conversation as resolved.
Show resolved Hide resolved
$dataTables->setDatatablesGroupColumn(1);
$dataTables->disableDatatablesColumnsSort(array(3, 8));
$dataTables->setDatatablesColumnsNotHideResponsive(array(8));
Expand Down