I’m trying to implement the scheduler in mvc3, and it works fine. But, i need to load the resources from a viewmodel class. Example A below is how the resources where loaded.
However, I would like to be able to do like Example B, using a for loop in the jquery section. Any suggestion would be appreciated. Thanks.
Example A
var rooms = [
{ key: 1, label: "Room A" },
{ key: 2, label: "Room B" },
{ key: 3, label: "Room C" },
{ key: 4, label: "Room D" }
];
Example B
Foreach(r in MyViewModel.Resources)
{
var rooms = [
{ key: @r.RoomID, label: @r.RoomName}
];
}