Update table content the second time does not work
See original GitHub issueI 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:
- Created 9 years ago
- Comments:10 (3 by maintainers)
Top GitHub Comments
In the first time to init the table, you needn’t to set
data-url
ordata
of the table, and it will be empty: http://jsfiddle.net/e3nk137y/348/, and then you useload
method to update your second table.Hope to help, close this issue.
Yes, before you use the methods you need to init the table, like this:
and the second question, you are right just set an empty array to do that.