-
Notifications
You must be signed in to change notification settings - Fork 17
Fixed reloading by fetching data from locoal storage on reload, and d… #456
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -118,10 +118,10 @@ | |||||
| @Input() dataType: DataType; | ||||||
|
|
||||||
| /** Function used to filter table data. */ | ||||||
| @Input() filterFn: (item: any, filterValue: string) => boolean; | ||||||
|
|
||||||
| /** The data source for the table. */ | ||||||
| @Input() dataSource: BaseDataSource<any>; | ||||||
|
|
||||||
| /** Flag to enable or disable pagination. */ | ||||||
| @Input() isPageable = false; | ||||||
|
|
@@ -186,19 +186,19 @@ | |||||
| @Input() supportsAutoRefresh = false; | ||||||
|
|
||||||
| /** Flag to color a table row */ | ||||||
| @Input() rowClass: (row: any) => string; | ||||||
|
|
||||||
| /** Event emitter for when the user triggers a row action */ | ||||||
| @Output() rowActionClicked: EventEmitter<ActionMenuEvent<any>> = new EventEmitter<ActionMenuEvent<any>>(); | ||||||
|
Check failure on line 192 in src/app/core/_components/tables/ht-table/ht-table.component.ts
|
||||||
|
|
||||||
| /** Event emitter for when the user triggers a bulk action */ | ||||||
| @Output() bulkActionClicked: EventEmitter<ActionMenuEvent<any>> = new EventEmitter<ActionMenuEvent<any>>(); | ||||||
|
Check failure on line 195 in src/app/core/_components/tables/ht-table/ht-table.component.ts
|
||||||
|
|
||||||
| /** Event emitter for when the user triggers an export action */ | ||||||
| @Output() exportActionClicked: EventEmitter<ActionMenuEvent<any>> = new EventEmitter<ActionMenuEvent<any>>(); | ||||||
|
Check failure on line 198 in src/app/core/_components/tables/ht-table/ht-table.component.ts
|
||||||
|
|
||||||
| /** Event emitter for when the user saves an editable input */ | ||||||
| @Output() editableSaved: EventEmitter<HTTableEditable<any>> = new EventEmitter<HTTableEditable<any>>(); | ||||||
|
|
||||||
| /** Event emitter for when the user saves a checkbox */ | ||||||
| @Output() editableCheckbox: EventEmitter<HTTableEditable<any>> = new EventEmitter<HTTableEditable<any>>(); | ||||||
|
|
@@ -555,12 +555,18 @@ | |||||
| * Reloads the data in the table and the bulk menu. | ||||||
| */ | ||||||
| reload(): void { | ||||||
| this.dataSource.reset(true); | ||||||
| this.dataSource.reset(false); | ||||||
| const tableSettings = this.uiSettings['uiConfig']['tableSettings'][this.name]; | ||||||
| this.dataSource.pageSize = tableSettings['page']; | ||||||
| this.dataSource.pageAfter = tableSettings['start']; | ||||||
| this.dataSource.pageBefore = tableSettings['before']; | ||||||
| this.dataSource.index = tableSettings['index']; | ||||||
| this.dataSource.totalItems = tableSettings['totalItems']; | ||||||
| this.dataSource.reload(); | ||||||
| if (this.bulkMenu) { | ||||||
| this.bulkMenu.reload(); | ||||||
| } | ||||||
| this.filterQueryFormGroup.get('textFilter').setValue(''); | ||||||
| this.filterQueryFormGroup.get('textFilter').setValue('', { emitEvent: false}); | ||||||
|
||||||
| this.filterQueryFormGroup.get('textFilter').setValue('', { emitEvent: false}); | |
| this.filterQueryFormGroup.get('textFilter').setValue('', { emitEvent: false }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing null/undefined checks for tableSettings and its properties could cause runtime errors if the settings don't exist in localStorage.