Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Where are the copied records with DragDataAction COPY

    Hi,

    When the DragDataAction is COPY, how can I access the copied record before it's added to the ListGrid? I can't seem to find any event which gives me access to that record.


    What I want to do is a variation of this:
    http://www.smartclient.com/smartgwt/showcase/#effects_dd_types
    we start with grey boxes,
    then move them to the blue or green target.
    While doing that, a copy of the grey box (so all of its properties are copied) is created, except a few properties are changed or added. E.g. the icon changes from grey to blue/green.


    Is this built-in or it the recommended solution to do the same as in
    http://www.smartclient.com/smartgwt/showcase/#effects_dd_create
    which is 'do the copy yourself by creating new child records' ?





    fyi this sample:
    http://www.smartclient.com/smartgwt/showcase/#effects_dd_copy_list
    is named 'Drag List (copy)' but doesn't actually do a copy (I had expected that the left grid keeps it content).


    thanks

    #2
    Can you not use addRecordDropHandler()?
    That method fires when the user drops data into the grid, and the dropped records can be accessed via event.getDropRecords()

    Comment


      #3
      Ah, sorry. Sometimes it's a bit confusing which method needs to defined on which component to get dragging working.

      I was already using the addRecordDropHandler to handle re-order of records from within the same component.
      Thanks to the RecordDropEvent.getSourceWidget() I can easily find out where the dropped records come from. Fantastic as usual!

      thanks

      Comment

      Working...
      X