I'm using kendo grid
with angular 1.x
, I fill the grid with new data according to user input. First data is set and works, second search does not update the table. Here is how I set the data source:
$scope.search = function () {
dataService.getData(searchQuery).then(function (res) {
$scope.isLoading = false;
if (res === false) {
$scope.dataError = true;
}else {
$scope.dataError = false;
$scope.noDataError = false;
drawTable(res);
}
});
}
function drawTable(res) {
$scope.mainGridOptions = {
dataSource: { data: res, pageSize: 10 },
autoBind: true,
height: 550,
groupable: true,
sortable: true,
pageable: {
refresh: true,
pageSizes: true,
buttonCount: 5,
pageSizes: [5, 10, 50, 100, 'All']
},
columns: [{
field: "ID",
title: "id",
width: 150
}, {
field: "ExtractedText",
title: "text",
width: 300
}, {
field: "DateTimeAppCreated",
title: "date created",
width: 200
}]
};
}