Table do not update after load data
See original GitHub issueHi all,
I have a problem when try to load data from API to the table, the table do not update unless I click on the filter box and click out.
Template
<ng2-smart-table [settings]="settings" [source]="pages"></ng2-smart-table>
Typescript
export class PageListComponent {
pages: LocalDataSource;
settings = {
columns: {
id: {
title: 'ID'
},
title: {
title: 'Title'
},
edit_link: {
title: 'Action'
}
},
pager: {
display: true,
perPage: 10
}
};
constructor(private pageSerice:PageService) {
this.pages = new LocalDataSource();
pageSerice.getAllPage().toPromise().then(data => {
this.pages.load(data);
this.pages.reset();
});
}
}
Service
getAllPage() {
//noinspection TypeScriptUnresolvedFunction
return this.http.get(window.location.origin + "/api/page").map(res => res.json());
}
Please help me solve this problem. Thank you so much.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:15 (4 by maintainers)
Top Results From Across the Web
HTML table not updating when data changed - Stack Overflow
I'm building a chart with an accompanying table. The data for both comes from html input elements with data provided by the user....
Read more >Data Refresh not updating table - Microsoft Power BI Community
1) check all the table queries, go to properties and be sure all have the update on refresh option seleccted, its just below...
Read more >mysql - Advantage of "LOAD DATA ... REPLACE INTO TABLE ...
Use LOAD DATA when importing large amounts of data or data from files. Personally, I have and would never use LOAD DATA for...
Read more >MySQL 8.0 Reference Manual :: 13.2.17 UPDATE Statement
UPDATE is a DML statement that modifies rows in a table. An UPDATE statement can start with a WITH clause to define common...
Read more >Create and run an update query - Microsoft Support
Overview. Using an update query. Update data from one table to another. Stop Disabled Mode from blocking a query. SQL version: UPDATE statement ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nnixaa Hello, I just figured out that this issue is caused by another directive. Sorry for this and slow response. I’ll close this.
@csepmdat no problem, glad it worked out well.