or
var
SchedulerWeekView = kendo.ui.MultiDayView.extend({
options: {
selectedDateFormat:
"{0:D} - {1:D}"
},
nextDate:
function
() {
var
startDate =
this
.startDate();
return
new
Date(startDate.setDate(startDate.getDate() + 7));
},
previousDate:
function
() {
var
endDate =
this
.endDate();
return
new
Date(endDate.setDate(endDate.getDate() - 7));
},
name:
"SchedulerWeekView"
,
calculateDateRange:
function
() {
var
selectedDate =
this
.options.date,
start = kendo.date.dayOfWeek(selectedDate,
this
.calendarInfo().firstDay, -1),
idx, length,
dates = [];
for
(idx = 0, length = 7; idx < length; idx++) {
if
(start.getDay() <= 5 && start.getDay() > 0) {
dates.push(start);
}
start = kendo.date.nextDay(start);
}
this
._render(dates);
}
});
dataSource:
new
kendo.data.HierarchicalDataSource({
transport: {
read: {
url:
'/WidgetJson/OrgTree'
,
type:
'POST'
,
dataType:
'json'
,
data:
function
(currentParams) {
var
params = {};
params[
'includeCardAccounts'
] = true;
return
params;
}
}
},
schema: {
model: {
id:
'OrgId'
,
hasChildren:
'HasChildren'
,
expanded:
'Expanded'
}
}
}),
dataTextField:
'OrgDescription'
[{
"OrgId"
:46431736,
"OrgDescription"
:
"XYZ DEPT Company"
,
"HasChildren"
:
true
,
"Expanded"
:
true
}]
[{
"OrgId"
:46431761,
"OrgDescription"
:
"OPExxxxxx - Ixx"
,
"HasChildren"
:
true
,
"Expanded"
:
false
},{
"OrgId"
:46431760,
"OrgDescription"
:
"OS xxxxxx IBA"
,
"HasChildren"
:
true
,
"Expanded"
:
false
},{
"OrgId"
:46431759,
"OrgDescription"
:
"ODSxxxxxx- IBx"
,
"HasChildren"
:
true
,
"Expanded"
:
false
}]