search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Update Resource Columns during CallBack in DayPilotScheduler

Asked by CSGuy57
13 years ago.
I'm using DayPilotScheduler to display employee schedules. Depending on the user's selection, I add additional columns into the Employee resources that display time and expense for the employee's schedule for the week. I can change resources during a CallBack (i.e. change the employees being displayed). However, I cannot add or remove the additional columns during the CallBack. The data inside the columns changes, but I cannot actually remove or add them. If I change the resources, they have whatever columns were initially loaded in the scheduler. If I look at the dps object on the client-side and look into the dps.rows property during the afterRender event, the columns are changed correctly based on what was done at the server, but they are not redrawn to the screen. Any ideas?
Answer posted by Dan Letecky [DayPilot]
12 years ago.

It seems to work fine. I've modified the Demo/Scheduler/RowHeaderColumns.aspx.cs example as follows:

    protected void DayPilotScheduler1_EventMove(object sender, DayPilot.Web.Ui.Events.EventMoveEventArgs e)
    {
        #region Simulation of database update
        // ...
        #endregion

        Resource r = DayPilotScheduler1.Resources.FindByValue(e.NewResource);
        if (r.Columns.Count == 0)
        {
            r.Columns.Add(new ResourceColumn());
        }
        r.Columns[0].InnerHTML = "Moved here";

        setDataSourceAndBind();
        DayPilotScheduler1.Update("Event moved.");
    }

It modifies the HTML of the first additional column after an event is moved.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.