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

[GLT-3991] add action buttons to the top #156

Merged
merged 3 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions changes/change_topButton
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Action buttons now appear at both top and bottom of the table
15 changes: 12 additions & 3 deletions ts/component/table-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,23 @@ export class TableBuilder<ParentType, ChildType> {
if (!data && !this.definition.queryUrl) {
throw new Error("Query url is required for loading table via AJAX");
}
const topControlsContainer = document.createElement("div");
topControlsContainer.className = "flex mt-4 items-top space-x-2";
djcooke marked this conversation as resolved.
Show resolved Hide resolved

if (!this.definition.disablePageControls) {
const topControlsContainer = document.createElement("div");
topControlsContainer.className = "flex mt-4 items-top space-x-2";
this.addSortControls(topControlsContainer);
this.addFilterControls(topControlsContainer);
}
if (this.definition.bulkActions || this.definition.staticActions) {
topControlsContainer.className =
"flex justify-end mt-4 items-top space-x-2";
djcooke marked this conversation as resolved.
Show resolved Hide resolved
this.addActionButtons(topControlsContainer);
}
if (!this.definition.disablePageControls) {
this.addPagingControls(topControlsContainer);
this.container.appendChild(topControlsContainer);
}
this.container.appendChild(topControlsContainer);

const tableContainer = document.createElement("div");
tableContainer.className = "mt-4 overflow-auto";
this.table = document.createElement("table");
Expand Down