Topic
  • 3 replies
  • Latest Post - ‏2012-12-11T10:05:02Z by SystemAdmin
Nic128
Nic128
15 Posts

Pinned topic TaskItem label don't update on ITEM_EDIT_MOVE

‏2012-08-06T18:19:43Z |
Hi,

My task items show its start and endTime in the label on the left (see image). If I move them (edit_move), the tooltip shows the new time in real time. However, the label on the left only updates on edit_end.

The data updates well. It just doesn't refresh until it has finished editing. If I try to refresh the taskdataprovider in edit_move, it doesn't work.

I'm using Elixir 2.5.

Thanks
Nicolas.
Updated on 2012-12-11T10:05:02Z at 2012-12-11T10:05:02Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1672 Posts

    Re: TaskItem label don't update on ITEM_EDIT_MOVE

    ‏2012-08-09T16:14:01Z  
    Hi Nicolas,

    This is the normal behavior of the Gantt charts in Elixir. As described in the user manual the GanttSheet works with instances of TaskItem, which serve as cache for the data provider items. At itemEditEnd the changes to the TaskItem are committed to the taskDataProvider, which in turn triggers an update of the datagrid.

    To implement your requirement you can for example commit the edited TaskItem to the task data provider during itemEditMove/Resize, something like:
    
    
    
    protected function ganttsheet1_itemEditMoveHandler(event:GanttSheetEvent):
    
    void 
    { var ganttSheet:GanttSheet = event.target as GanttSheet; var taskItem:TaskItem = ganttSheet.itemToTaskItem(event.item); 
    // Commit the change to the task data provider item. ganttSheet.commitItem(taskItem); 
    // Notify the change in case the data provider item is not dispatching. 
    
    if (!(event.item is IPropertyChangeNotifier)) 
    { var collection:ICollectionView = ganttSheet.ganttChart.taskDataProvider as ICollectionView; collection.itemUpdated(event.item); 
    }
    


    Note that you will have to re-implement the cancel editing feature of the GanttSheet: pressing ESC while editing a task in the GanttSheet aborts editing and the reverts the TaskItem to the initial values from the data provider item. To re-implement this feature you have to:
    • handle itemEditBegin to save the initial state of the data provider item (make sure to clone the Date values).
    • handle itemEditEnd to restore the state of the data provider item in case event.reason is GanttSheetEventReason.CANCELLED.

    Hope this helps,
    Frédéric
  • Nic128
    Nic128
    15 Posts

    Re: TaskItem label don't update on ITEM_EDIT_MOVE

    ‏2012-08-13T15:18:58Z  
    It works.

    Thanks.
  • SystemAdmin
    SystemAdmin
    1672 Posts

    Re: TaskItem label don't update on ITEM_EDIT_MOVE

    ‏2012-12-11T10:05:02Z  
    in this case i can not drag the task item as my wish..