question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Table do not update after load data

See original GitHub issue

Hi 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:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
datpmworkcommented, Sep 4, 2016

@nnixaa Hello, I just figured out that this issue is caused by another directive. Sorry for this and slow response. I’ll close this.

1reaction
nnixaacommented, Sep 4, 2016

@csepmdat no problem, glad it worked out well.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found