Thank you for contacting Syncfusion support.
We have prepared the sample to dynamically add the resource which can be download from the below location.
In the above sample, when a button is clicked, new resource will be added to the Scheduler. Kindly refer the below code example used in the sample.
<Code>
$("#BindData").click(function () {
var resData = [{ text: "Oliver", id: "4", groupId: "2", color: "#ffaa00" }];
var schObj = $("#Schedule1").data("ejSchedule");
schObj.model.resources[1].resourceSettings.dataSource.push(resData[0]); // here we are dynamically adding the resource
var resVal = schObj.model.resources[1].resourceSettings.dataSource; // here total no of resources will be stored
var modelRoomData = @Html.Raw(Json.Encode(ViewBag.Rooms)); // here we are getting the Room data collection from controller
var modelAppData = @Html.Raw(Json.Encode(ViewBag.datasource));
var AppData = [];
for (var i = 0; i < modelAppData.length; i++) {
AppData[i] = {
Id: modelAppData[i].Id,
Subject: modelAppData[i].Subject,
StartTime: new Date(modelAppData[i].StartTime.match(/\d+/)[0] * 1),
EndTime: new Date(modelAppData[i].EndTime.match(/\d+/)[0] * 1),
AllDay: modelAppData[i].AllDay,
Recurrence: modelAppData[i].Recurrence,
RecurrenceRule: modelAppData[i].RecurrenceRule,
OwnerId:modelAppData[i].OwnerId,
RoomId:modelAppData[i].RoomId
}
}
------------
------------
});
</Code>