1 Reply Latest reply on Oct 10, 2008 6:52 AM by ericbelair

    Reusing command logic between itemEditor and parent DataGrid

    ericbelair Level 1
      I have a component that allows users to edit one of the properties of individual items in a DataGrid with an itemEditor that extends my custom PopMenuButton component. The component also allows users to edit multiple items using that same component.

      Right now, I have duplicate logic - both in the itemEditor class and the DataGrid's parent component - to handle the user's selection and update the data object. The logic in the itemEditor updates the one item that the editor is accessing, and the logic in the DataGrid's parent component loops through the selectedItems Array of the DataGrid and updates the items one at a time.

      I'd like to eliminate the need for duplicate code here. Is there easy way to have the itemEditor bubble an event to the parent an have it access the functions in that component to perform it's updates?

      Thanks.