Angular Kendo调度程序刷新

时间:2015-05-04 22:27:08

标签: javascript angularjs kendo-ui kendo-scheduler

我有一个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()中传递的选择刷新网格内的数据。我该怎么做?

1 个答案:

答案 0 :(得分:0)

这将符合此设置。我没有测试它,但它应该工作。当您调用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}; }