我刚刚开始使用Kendo Grid,到目前为止我讨厌它。我发现简单的任务很难,而且更难以获得帮助。目前,我有一个带有按钮的网格,该按钮运行一种方法来更改我的SQL数据库中的数据。但是,在程序完成后,我无法刷新网格。我必须在浏览器中按F5才能看到更改。这是我的控制器代码:
$scope.gridOptions = {
dataSource: {
transport:{
read:{
url:'/SSQV4/SSQV5/Search/GetBusinessUnits',
type: "GET"
}
},
sort: {field: "intOrder", dir:"asc"}
},
batch: false,
reorderable: true,
sortable: false,
editable: "inline",
columns: [
{ template: '<i class="fa fa-chevron-circle-up" style="cursor:pointer" ng-click="MoveUp(#=OperatorBusinessUnitID#)"></i> <i class="fa fa-chevron-circle-down" style="cursor:pointer"></i>', title: "List Order" },
{ field: "intOrder"},
{ field: "OperatorBusinessUnitID", title: "Business Unit ID" },
{ field: "vchDescription", title: "Business Unit Name" },
{ field: "vchOperatorSystemID", title: "Operator System ID"},
{
command: [
{ name: "edit", text: " " },
{ name: "destroy", text: " " },
], title: "Action"
}
]
};
$scope.MoveUp = function (id) {
operatorService.moveup(id)
.success(function (data) {
$scope.businessUnits = data;
$timeout(function () {
$scope.grid.dataSource.read();
}, 7000)
});
};
这是我的HTML:
<div ng-app="myModule" ng-controller="OperatorCtrl ">
<kendo-grid k-options="gridOptions" k-scope-field="grid">
</kendo-grid>
</div>
如果有人知道如何解决这个问题,请帮助。
非常感谢任何帮助!