Timeline view collection change client side

Hi,

I have successfully loaded up the scheduler with information on over a 1000 appointments and am using a filter changer (client side) to allow me to see appointments for different people.

I am currently attempting to use the timeline view to see several people’s appointments at once (similar to that on the cars example), however, i am trying to change between the week view and multiple users timeline on the client side as the amount of data being sent back and forth creates too long a delay if done otherwise.

There is an assignedto attribute in all the appontments sent to the scheduler so i was wondering how i can populate the timeline view with the list of users required and filter the jobs by assignedto on the client side.

I would be most grateful for any support

Thanks,

Matt Jeffrey

Hello Matt,

Please check this topic
viewtopic.php?f=25&t=26799&start=0
And here is documentation on filtering on the client
docs.dhtmlx.com/doku.php?id=dhtm … filtration

So, would i set the key to be assignedto?

I am currently getting a blank timeline

This is initialising the view within the controller

var units = new TimelineView("UserGroups", "assignedto");
            units.X_Step = 2;
            units.X_Length = 12;
            units.X_Size = 12;
            //width of the first column
            units.Dx = 149;
            //row height
            units.Dy = 76;
            //order bar height
            units.EventDy = units.Dy - 5;
            //units.AddOptions(cars);
            units.RenderMode = TimelineView.RenderModes.Bar;
            scheduler.Views.Add(units);

This is telling the scheduler to display the controller and what users to put in

    function getUserGroupNames(tvEl) {
        var userNames = [];
        var userList = tvEl.parentElement.children[1].children;

        for (var i = 0, max = userList.length; i < max; i++) {
            var user = userList[i].children[0].id;
            var json = { key: user, label: userList[i].children[0].innerText };
            userNames.push(json);
        }

        return userNames;
    }

 var userGroupNames = getUserGroupNames(obj);
            var listName = scheduler.config.serverLists["timeline"];
            scheduler.updateCollection(listName, userGroupNames);
            scheduler.setCurrentView(new Date(2012, 11, 9), "UserGroups");

The json for each event is

{id:{0}, text:\"{1}\", start_date:\"{2:MM/dd/yyyy HH:mm}\", end_date:\"{3:MM/dd/yyyy HH:mm}\", assignedto:\"{4}\"}

Thank you for your help

Hello Matt,

var units = new TimelineView("UserGroups", "assignedto"); ... //units.AddOptions(cars); Timeline should have initial set of units to be rendered correctly, it can’t be empty. Try setting default values.
One more thing, instead of
var listName = scheduler.config.serverLists[“timeline”];
you should use
var listName = scheduler.config.serverLists[“UserGroups”];
since view name is “UserGroups”, as it provided to the constructor.
Everything else seems correct to me