【发布时间】:2017-02-12 05:33:56
【问题描述】:
我在我的项目中使用 kendo ui 调度程序,但是在客户端下载 kendo js 和 css 需要太多时间,因此我们的网站会出现一些缓慢。为了克服这个问题,我们试图根据请求仅在加载调度程序日历的页面上下载 kendo js 和 css。虽然集成相同,但我们无法添加依赖项“kendo.directive”。请建议如何添加该依赖项或替代方法来减少这么多的延迟。
请找到相同的代码。
myApp.requires.push('kendo.directives');
myApp.controller('CalenderController',['$scope', '$http', 'StatsService', function ($scope, $http, StatsService) {
var self=this;
$scope.schedulerOptions = {
date: new Date(),
startTime: new Date(),
showWorkHours: true,
height: 600,
views: [
"day",
{type: "week", selected: true},
],
editable: {
destroy: false,
create: false,
template: $("#editor").html()
},
timezone: "GMT",
dataSource: {
batch: true,
transport: {
read: function (options) {
url = '/consultants/applications/interviews';
$http.get(url).success(function (data, status, headers, config) {
options.success(data.result);
}).error(function (data, status, headers, config) {
options.error(data);
});
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return {models: kendo.stringify(options.models)};
}
}
},
schema: {
model: {
id: "interviewId",
fields: {
taskId: {from: "id", type: "number", editable: false},
candidateName: {from: "candidateName" , editable: false},
title: {from: "title", defaultValue: "No title" , editable: false},
companyName: {from: "companyName" , editable: false},
start: {type: "date", from: "interviewTiming", editable: false},
end: {type: "date", from: "interviewEndTiming" , editable: false},
candidateEmail: {from: "candidateEmail" , editable: false},
candidateMobile: {from: "candidateMobile" , editable: false}
}
}
}
}
};
}]);
【问题讨论】:
标签: css angularjs user-interface kendo-ui scheduler