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.

Datatable doesn't get updated (doesn't show rows) after inserting new data into the rows array

See original GitHub issue

I’m submitting a … (check one with “x”)

[#] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here

Current behavior

I’ve made a video of the problem, you can find it here: http://encircle360share.s3-eu-central-1.amazonaws.com/Screen-Recording-2017-02-04-11-23-11.mp4

Using external pagination the data on the next pages using paginations doesn’t get shown although it’s already there. Only after changing the page and changing back again to the page before shows the data (view gets updated). It’s also possible to scroll horizontally if the data is missing and the data will occur (view gets refreshed/updated). I think that might be a change detection problem.

Expected behavior Direct visibility of the rows/data after paginating.

Please tell us about your environment:

Mac OS X Sierra, IntelliJ IDEA

  • Table version: 6.0.2 (current stable)

  • Angular version: 2.4.4

  • Browser: all; tested with: Firefox, Chrome, Safari, Opera

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ersatishcommented, Sep 8, 2018

I have also faced this issue and resolve it with the help of ng-If because. When you get the latest data from server set previous data set to null and in template as a-if to controll it.

0reactions
MorlaRamakrishnacommented, Jun 7, 2017

I have followed @amcdnl suggestion by setting a brand new array for [rows] even though facing the same issue.

my code is here:

setPage(selection:any){
        this.pageNum=selection.offset;
        this.reconcileService.query({
            page: selection.offset,
            size: selection.limit}).subscribe(
            (res: Response) =>{ 
                this.tableRows.splice(0,this.tableRows.length);
                console.log(this.tableRows);
                this.abc=res.json();
                this.abc.forEach(item=>{ 
                    this.tableRows.push(item);
                });
                this.totalRows=res.headers.get('X-Total-Count');
                console.log(res.headers.get('X-Total-Count'));
                console.log(this.tableRows);
            },
            (res: Response) =>{                 
                console.log(res.json());
            }
        );
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Row not updating after editing data — DataTables forums
I have an issue with my rows data not updating after I edit the data in my editor.
Read more >
DataTable does not re-draw after updating rows - Stack Overflow
$('#updateRow').click(function() { //Get the table var table = $('#example').DataTable(); //Iterate over selected rows var rowData = table.rows ...
Read more >
Table (view) is not update when the rows are updated #255
The view (table) and the array is updated with a new element. ... (in my component which use angular2-data-table) but this doesn't work:....
Read more >
Updating the Data for an LWC lightning-datatable isn't re ...
My guess is that the table doesn't know to update because you have specified a key field of id but you have not...
Read more >
How to Lock Cell Formula References for Table Columns in ...
When you start using data tables in Excel, many users are frustrated to ... that the normal methods for freezing the row or...
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