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.

Update table content the second time does not work

See original GitHub issue

I have a problem with my tables …

I have 2 tables on one page … one page where i select an employee, triggers the other table to update its content by POST method to a PHP file. Looking at the result i can see that i get the correct reply from my webservice. The first time i select an employee the second table is updatede correctly, using the data property. But when i select a new employee after that (i still see the reply from my service is correct) it does not update the second table any more, the old data is still present. As if setting the data property the second time does not trigger an update of the table ??

Here’s the interesting part of my function:

$('#report-table').bootstrapTable('showLoading');               
$.ajax({
    type: "POST",
    url: "getReportsForEmployee.php",
    data: "id=" + row['id'],
    dataType:"json",
    success : function(data) 
    {   
        $('#report-table').bootstrapTable('hideLoading');
        $('#notification').hide();  
        $('#report-table').bootstrapTable({
            data: data
        });
    }
});

As mentioned i have reviewed the respons from my webservice, and it is OK. First time it updates the table, the second (third… . . … .) it doesnt… ?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wenzhixincommented, Jan 20, 2015

In the first time to init the table, you needn’t to set data-url or data of the table, and it will be empty: http://jsfiddle.net/e3nk137y/348/, and then you use load method to update your second table.

Hope to help, close this issue.

1reaction
wenzhixincommented, Jan 19, 2015

Yes, before you use the methods you need to init the table, like this:

<table id="report-table" data-toggle="table">
</table>

and the second question, you are right just set an empty array to do that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing some table of contents update issues
There are several ways you can do this — put your cursor anywhere in the TOC then: right-click and select Update Field; press...
Read more >
sql server - Update query is taking 2 seconds to update the table
I need to update this table based on two column values. For update, system is taking 2 seconds. Please help me how optimize...
Read more >
Update a table of contents - Microsoft Support
Go to References > Update Table. ... Select one of the following: ... Note: Manually created tables (not created automatically from the headings),...
Read more >
Updating SQL Table gets stuck on "Preparing Update Script ...
My only workaround is to fully close and then re-open visual studio. However, this just allows me to do one more update, since...
Read more >
Update Trigger not working unless update twice - Caspio Forum
Hoping someone can help me. I have two tables and the first table has a trigger as shown below: The trouble i am...
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