I have one bootstrap table with the following code.
<table id="tblPendingRequests" data-height="300">
<thead>
<tr>
<th data-field="Version">Version</th>
<th data-field="Env">Env</th>
<th data-field="Release">Release</th>
<th data-field="CreatedBy">Created By</th>
<th data-field="Action">Action</th>
</tr>
</thead>
</table>
added below references also.
function loadData(){
$(function () {
$('#tblPendingRequests').bootstrapTable({});
});
}
Then I am loading some data to this table with the following lines of code
var mydata = {
"Version": data[index].DeploymentName, "Env": data[index].EnvName,
"Release":data[index].ReleaseName, "CreatedBy": data[index].UpdatedBy
"Action": ActionButton
};
testData.push(mydata);
updateData(testData);
function updateData(myData) {
$('#tblPendingRequests').bootstrapTable("append", myData);
}
It is diplaying the data properly. I have one project dropdown on the page. Onchange of the project name i want to populate this table with fresh data. It is not happening. It is appending data to existing table data which i dont want. How to refresh the table and load new data in the table.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…