-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add example for row selection and update row hover (active)
- Loading branch information
Hjalmers
committed
Aug 7, 2023
1 parent
b92df1e
commit 8421d59
Showing
12 changed files
with
3,073 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
projects/docs/src/app/examples/row-select/row-select.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<div class="row gy-3 gy-sm-0 gx-2 align-items-center"> | ||
<div class="col-12 col-sm-auto"> | ||
<button | ||
class="btn w-100" | ||
(click)="toggleRowHover()" | ||
[class.btn-outline-primary]="!activateOnRowHover" | ||
[class.btn-primary]="activateOnRowHover" | ||
> | ||
{{ activateOnRowHover ? "Disable on hover" : "Enable on hover" }} | ||
</button> | ||
</div> | ||
<div class="col-12 col-sm-auto"> | ||
<button | ||
class="btn w-100" | ||
(click)="toggleRowNavigation()" | ||
[class.btn-outline-primary]="!activateOnNavigation" | ||
[class.btn-primary]="activateOnNavigation" | ||
> | ||
{{ | ||
activateOnNavigation | ||
? "Disable on keyboard navigation" | ||
: "Enable on keyboard navigation" | ||
}} | ||
</button> | ||
</div> | ||
<div class="col-12 col-sm-auto"> | ||
<button | ||
class="btn w-100" | ||
[class.btn-outline-primary]="!isAllSelected" | ||
[class.btn-primary]="isAllSelected" | ||
(click)="toggleAll()" | ||
> | ||
{{ isAllSelected ? "Deselect all" : "Select all" }} | ||
</button> | ||
</div> | ||
</div> | ||
<div class="row gy-3 gy-sm-0 gx-2 align-items-center mt-3"> | ||
<div class="form-group col-12 col-sm-auto d-flex align-items-center"> | ||
<label for="length_input" class="text-nowrap me-2">Number of rows:</label> | ||
<input | ||
id="length_input" | ||
[formControl]="lengthCtrl" | ||
type="number" | ||
class="form-control" | ||
style="max-width: 60px" | ||
/> | ||
</div> | ||
<div class="col-12 col-sm-auto"> | ||
Selected rows: {{ (selection | keyvalue).length }} | ||
</div> | ||
<div class="col-12 col-sm-auto"> | ||
Active row id: {{ (activeRow$ | async)?.id ?? "none" }} | ||
</div> | ||
</div> | ||
<div class="mx-n3 mx-sm-0 my-3 overflow-auto"> | ||
<angular-generic-table | ||
[data]="data$" | ||
[config]="config$" | ||
[loading]="loading$" | ||
[isRowSelectedFn]="isSelected" | ||
[customClasses]="customClassNames" | ||
(rowClick)="selectRow($event)" | ||
(rowActive)="setActiveRow($event)" | ||
(rowSelect)="selectRow($event)" | ||
[selection]="selection" | ||
#tableRef | ||
> | ||
<div class="table-loading gt-skeleton-loader"></div> | ||
<div class="table-no-data alert alert-info mt-3">Table is empty</div> | ||
</angular-generic-table> | ||
<angular-generic-table-pagination [table]="tableRef"> | ||
</angular-generic-table-pagination> | ||
</div> |
Oops, something went wrong.