var appointmentData = 
{
    "appointmentData":
        [
            {
                "Id": "1",
                "StatusColor": "#67aa9e",
                "Subject": "Meeting 1",
                "StartTime": "2020-12-14 10:54:26",
                "EndTime": "2020-12-14 14:54:26",
                "RoomId": "105",
                "StatusId": "5",
                "LevelId": "1"
            },
            {
                "Id": "2",
                "StatusColor": "#67aa9e",
                "Subject": "Meeting 1",
                "StartTime": "2020-12-14 10:54:26",
                "EndTime": "2020-12-14 14:54:26",
                "RoomId": "105",
                "StatusId": "5",
                "LevelId": "1"
            },
            {
                "Id": "3",
                "StatusColor": "#67aa9e",
                "Subject": "Meeting 1",
                "StartTime": "2020-12-14 10:54:26",
                "EndTime": "2020-12-14 14:54:26",
                "RoomId": "105",
                "StatusId": "5",
                "LevelId": "1"
            },
            {
                "Id": "4",
                "StatusColor": "#67aa9e",
                "Subject": "Meeting 1",
                "StartTime": "2020-12-14 10:54:26",
                "EndTime": "2020-12-15 14:54:26",
                "RoomId": "205",
                "StatusId": "2",
                "LevelId": "2"
            },
            {
                "Id": "5",
                "StatusColor": "#67aa9e",
                "Subject": "Meeting 1",
                "StartTime": "2020-12-14 13:54:26",
                "EndTime": "2020-12-15 14:54:26",
                "RoomId": "205",
                "StatusId": "2",
                "LevelId": "2"
            },
            {
                "Id": "6",
                "StatusColor": "#67aa9e",
                "Subject": "Meeting 1",
                "StartTime": "2020-12-14 10:54:26",
                "EndTime": "2020-12-15 14:54:26",
                "RoomId": "205",
                "StatusId": "2",
                "LevelId": "2"
            },
            {
                "Id": "7",
                "StatusColor": "#67aa9e",
                "Subject": "Meeting 1",
                "StartTime": "2020-12-14 12:54:26",
                "EndTime": "2020-12-15 14:54:26",
                "RoomId": "101",
                "StatusId": "4",
                "LevelId": "1"
            },
            {
                "Id": "8",
                "StatusColor": "#67aa9e",
                "Subject": "Meeting 1",
                "StartTime": "2020-11-14 10:54:26",
                "EndTime": "2020-12-15 14:54:26",
                "RoomId": "101",
                "StatusId": "4",
                "LevelId": "1"
            },
            {
                "Id": "9",
                "StatusColor": "#67aa9e",
                "Subject": "Meeting 1",
                "StartTime": "2020-12-14 13:54:26",
                "EndTime": "2020-12-15 14:54:26",
                "RoomId": "104",
                "StatusId": "3",
                "LevelId": "1"
            },
            {
                "Id": "10",
                "StatusColor": "#67aa9e",
                "Subject": "Meeting 1",
                "StartTime": "2020-12-14 10:54:26",
                "EndTime": "2020-12-15 14:54:26",
                "RoomId": "104",
                "StatusId": "3",
                "LevelId": "1"
            },
            {
                "Id": "11",
                "StatusColor": "#67aa9e",
                "Subject": "Meeting 1",
                "StartTime": "2020-12-13 18:04:26",
                "EndTime": "2020-12-14 06:04:26",
                "RoomId": "103",
                "StatusId": "3",
                "LevelId": "1"
            },
            {
                "Id": "12",
                "StatusColor": "#67aa9e",
                "Subject": "Meeting 1",
                "StartTime": "2020-12-14 04:40:26",
                "EndTime": "2020-12-15 13:40:26",
                "RoomId": "103",
                "StatusId": "3",
                "LevelId": "1"
            }
        ]
    };

var getEbene = {"getEbene" :[{"Id":"1","EbeneText":"Ebene 1","EbeneColor":"#cb23ff","LevelId":"1"},{"Id":"2","EbeneText":"Ebene 2","EbeneColor":"#4ce100","LevelId":"2"},{"Id":"3","EbeneText":"Ebene 3","EbeneColor":"#fd4327","LevelId":"3"}]};
var getRaum = {"getRaum" :[{"Id":"101","RaumText":"Raum 101","RaumColor":"#3d5c0e","refEbene":"1","RoomId":"101"},{"Id":"102","RaumText":"Raum 102","RaumColor":"#a97d8d","refEbene":"1","RoomId":"102"},{"Id":"103","RaumText":"Raum 103","RaumColor":"#02f46c","refEbene":"1","RoomId":"103"},{"Id":"104","RaumText":"Raum 104","RaumColor":"#b8881d","refEbene":"1","RoomId":"104"},{"Id":"105","RaumText":"Raum 105","RaumColor":"#91a619","refEbene":"1","RoomId":"105"},{"Id":"201","RaumText":"Raum 201","RaumColor":"#8dfbd6","refEbene":"2","RoomId":"201"},{"Id":"202","RaumText":"Raum 202","RaumColor":"#86f293","refEbene":"2","RoomId":"202"},{"Id":"203","RaumText":"Raum 203","RaumColor":"#55791c","refEbene":"2","RoomId":"203"},{"Id":"204","RaumText":"Raum 204","RaumColor":"#c45b90","refEbene":"2","RoomId":"204"},{"Id":"205","RaumText":"Raum 205","RaumColor":"#fcc78b","refEbene":"2","RoomId":"205"},{"Id":"301","RaumText":"Raum 301","RaumColor":"#cf92ec","refEbene":"3","RoomId":"301"},{"Id":"302","RaumText":"Raum 302","RaumColor":"#2c56fa","refEbene":"3","RoomId":"302"},{"Id":"303","RaumText":"Raum 303","RaumColor":"#595c43","refEbene":"3","RoomId":"303"},{"Id":"304","RaumText":"Raum 304","RaumColor":"#805726","refEbene":"3","RoomId":"304"},{"Id":"305","RaumText":"Raum 305","RaumColor":"#80bf22","refEbene":"3","RoomId":"305"}]
}
    console.log(appointmentData);
var scheduleObj = new ej.schedule.Schedule({
    width: '100%',
    height: '700px',
    rowAutoHeight: false,
    selectedDate: new Date(),
    firstDayOfWeek: 1,
    views: 
    [
        { option: 'TimelineDay', allowVirtualScrolling: true, interval: 5},
        { option: 'TimelineWeek', allowVirtualScrolling: true, interval: 5 }, 
        { option: 'TimelineMonth' , allowVirtualScrolling: true, interval: 5 },
        { option: 'TimelineYear' , allowVirtualScrolling: true, orientation:'Vertical', interval: 5}
    ],
    group: {
        resources: ['Levels', 'Rooms']
    },
    resources: [{
        field: 'LevelId', title: 'Ebene',
        name: 'Levels', allowMultiple: false,
        dataSource: 
            getEbene.getEbene
        ,
        textField: 'EbeneText', idField: 'Id', groupIDField: 'LevelId', colorField: 'EbeneColor'
        },
        {
        field: 'RoomId', title: 'Raum',
        name: 'Rooms', allowMultiple: false,
        dataSource: 
            getRaum.getRaum
        ,
        textField: 'RaumText', idField: 'Id', groupIDField: 'refEbene', colorField: 'RaumColor'
        }
    ],
    eventSettings: 
    { 
        dataSource: appointmentData.appointmentData,
        enableTooltip: true 
    },
    dataBinding: function(args)
    {
        console.log("dataBinding",args); 
    },
    dataBound: function(args)
    {
        console.log("dataBound",args); 
    }
});

scheduleObj.appendTo('#Schedule');