Hello,
I am having a strange problem and cannot find any solution. I have a simple grip in popup:
<script>
function createDepositsTable() {
$("#depositsTable").kendoGrid({
height: 200,
scrollable: true,
dataSource: {
data: depositdata
},
resizable: true,
columns: [
{
field: "TransactionDate",
title: "Date",
type: "date",
headerAttributes: { style: "vertical-align: top;white-space: normal" },
format: "{0:MM-dd-yyyy}",
attributes: { class: "text-left" }
}, {
field: "Value",
title: "Amount",
headerAttributes: { style: "vertical-align: top;white-space: normal" },
format: "{0:c2}",
attributes: { class: "text-right" }
}],
});
console.log(depositdata);
var grid = $("#depositsTable").data("kendoGrid");
grid.bind();
}
Another dropdown selects an account and gets the data. Initially 9 records populated in datasource for grid and they displayed fine. If I select another account, 2 records populated and I can see them in console.log(depositdata); => 2 records, but the grid will display the old ones plus new = 11. Any other selection will just add new records to the end of the grid. I did try re-bind: grid.bind();
re-create:
$(document).ready(createDepositsTable);
$(document).bind("kendo:skinChange", createDepositsTable);
refresh, but nothing helped. Do you have any idea what could be done here?
Thanks.