function onChange(e) {
var roomData = @Html.Raw(Json.Encode(ViewBag.Rooms));
var ownerData = @Html.Raw(Json.Encode(ViewBag.Owners));
var grupData=@Html.Raw(Json.Encode(ViewBag.Resources));
if (e.isChecked) { //it will show resource
$("#Schedule1").ejSchedule({
group: {
resources: grupData
},
resources: [
{
field: "RoomId",
title: "Room",
name: "Rooms", allowMultiple: false,
resourceSettings: {
dataSource: roomData,
text: "text", id: "id", groupId: "groupId", color: "color"
}
}, {
field: "OwnerId",
title: "Owner",
name: "Owners", allowMultiple: true,
resourceSettings: {
dataSource: ownerData,
text: "text", id: "id", groupId: "groupId", color: "color"
}
}],
appointmentSettings: {
resourceFields: "RoomId,OwnerId"
}
});
}
else { // it will hide resource
$("#Schedule1").ejSchedule({
resources: [], // here we are removing the resources to render default schedule control
appointmentSettings: {
resourceFields: " "
}
});
}
}</Code>
Regards,
Karthigeyan