【发布时间】:2018-03-08 13:41:01
【问题描述】:
我使用kendo grid 和angular 1.x,我根据用户输入用新数据填充网格。第一个数据已设置并有效,第二个搜索不更新表。以下是我设置数据源的方式:
$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
}]
};
}
【问题讨论】:
标签: angularjs kendo-ui kendo-grid