DHTMLXScheduler .cshtml

Hi,

I need help. I had convert this code
var Rooms = [@for(var i =0; i < Model.rooms.Count; i++){

        { key:@(Model.rooms[i].leavetype_id), label: "@(Html.Encode(Model.rooms[i].title))"}@(i<Model.room.Count-1 ? "," : "")  

    }];

But unfortunately not work.

Please advise. Also, do you have DHTMLXSCheduler using cshtml(HTML5) format?

Thank you.

Regards,
Micheale

Hi,
i’ll try to get an example in the nearest time.
As for rooms array, I would render it with JavaScriptSerializer. It will output json string that can be inserted directly into javascript code. Something like following:[code]@{
var jsArray = new JavaScriptSerializer().Serialize(
Model.rooms.Select(
r => new {key = r.leavetype_id, label = Html.Encode(r.title)}
)
)
}

[/code]