0

我想按日期过滤事件,但日期是通过正常输入类型 =“文本”而不​​是 kendo 默认 datepicker 传递的。并在 kendo schduler 标题中显示传递日期但不能更改查看日期。这是我的代码....... ..

 $scope.searchEventByDate = function (item) {
    var scheduler = $("#scheduler").data("kendoScheduler");
    scheduler.view().startDate(item.StartDate);
    scheduler.view().endDate(item.EndDate);
    scheduler.view(("day"));
    $scope.scheduler.dataSource.read();       
};

这是我的过滤器参数

 parameterMap: function (options, operation) {
                var popupheight = $(window).height() - 180 + 'px';
                $scope.popupWraperForTryout = popupheight;
                var scheduler = $("#scheduler").data("kendoScheduler");
                if (searchCount != 0) {
                    if (operation === "read") {
                        return {
                            filterByPersonalEvent: $scope._filterParamObj.filterBypersonal,
                            filterBySignUpRequired: $scope._filterParamObj.filterBySingupRequired,
                            filterByPaidOrFree: $scope._filterParamObj.filterByPaid,
                            filterByEventStatus: $scope._filterParamObj.eventStatusId,
                            filterByEventType: $scope._filterParamObj.eventTypeId,
                            selectedTeam: $scope._filterParamObj.seasonTeamId,
                            filterByStartDate: scheduler.view().startDate(),
                            filterByEndDate: scheduler.view().endDate(),
                            OrgId: _orgId,
                            UserTimezone: global.userTimezoneOffset
                        }
                    }
                }
            },

我很累。这个代码在查看日期没有改变。请帮帮我

4

1 回答 1

1

这里有几个问题 - 日视图仅显示一天;你不能设置 startDate 和 endDate - 只是日期。

$scope.searchEventByDate = function (item) {
  var scheduler = $("#scheduler").data("kendoScheduler");
  //scheduler.view().startDate(item.StartDate);
  //scheduler.view().endDate(item.EndDate);
  scheduler.view("day");
  // item.StartDate should be Date object - like scheduler.date(new Date("2013/6/6"));
  scheduler.date(item.StartDate);
  $scope.scheduler.dataSource.read();       
};

如果您需要设置一些明确的日期范围来过滤 - 您可以这样做,但您仍然不能在日视图中显示超过一天。

$scope.searchEventByDate = function (item) {
  var scheduler = $("#scheduler").data("kendoScheduler");
  scheduler._myFilterStartDate = item.StartDate;
  scheduler._myFilterEndDate = item.EndDate;
  scheduler.view("day");
  scheduler.date(item.StartDate);
  $scope.scheduler.dataSource.read();       
};      

在参数图中:

...
return {
  filterByStartDate: scheduler.view().startDate(),
  filterByEndDate: scheduler.view().endDate(),
  myFilterStartDate: scheduler._myFilterStartDate,
  myFilterEndDate: scheduler._myFilterEndDate,
  OrgId: _orgId,
  UserTimezone: global.userTimezoneOffset
};
...
于 2015-10-22T15:07:05.767 回答