Skip to content

Commit

Permalink
Merge pull request #1743 from Admidio/fix-HtmlDataTable
Browse files Browse the repository at this point in the history
  • Loading branch information
MightyMCoder authored Jan 29, 2025
2 parents c0a806d + 4dcc5d4 commit 5c8616e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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, 'adm_documents_files_table');
$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, 'adm_role_permissions_table');
$dataTables->setDatatablesGroupColumn(1);
$dataTables->disableDatatablesColumnsSort(array(3, 8));
$dataTables->setDatatablesColumnsNotHideResponsive(array(8));
Expand Down

0 comments on commit 5c8616e

Please sign in to comment.