我有一个kendo-angular调度器,如下所示:
var kendoDataSource = new kendo.data.SchedulerDataSource({
schema: {
model: {
fields: {
id:{defaultValue:2}
}
}
},
});
$scope.schedulerOptions = {
date: new Date(),
height: 450,
views: ["day", "week", "month", "agenda"],
editable: { template: $("#editor").html() },
dataSource: {
batch: true,
transport: {
read: {
url: "http://192.168.1.121:8000/pp/getevent/"+$rootScope.selectedstud.pk,
dataType: "json"
}
}
}
};我的html如下:
<div kendo-scheduler="grid" k-options="schedulerOptions" id="schedule">
<span k-event-template class='custom-event'>{{dataItem.title}}</span>
<div k-all-day-event-template class='custom-all-day-event'>{{dataItem.title}}</div>
</div>我正在尝试根据在read()中传递的选择来刷新网格中的数据。我该怎么做呢?
发布于 2015-05-06 01:26:08
它将沿着这个设置的路线进行。我还没有测试它,但它应该可以工作。当您调用read方法时,它将包含数据函数返回对象。祝好运。
$scope.schedulerOptions = {
date: new Date(),
height: 450,
views: ["day", "week", "month", "agenda"],
editable: { template: $("#editor").html() },
dataSource: {
batch: true,
transport: {
read: {
url: "http://192.168.1.121:8000/pp/getevent/"+$rootScope.selectedstud.pk,
dataType: "json",
data: "additionalParams"
}
}
}
};
function addtionalParams(){ return { param1: 1, param1: 2}; } https://stackoverflow.com/questions/30041089
复制相似问题