Drag and Drop between two grids doesn't show dragged records as modified

  1. #1

    Drag and Drop between two grids doesn't show dragged records as modified

    Hello,
    I implemented a page with drag and drop between 2 grids exactly as the example in the demos page (same js code and both grids identical):

    https://examples1.ext.net/#/DragDrop...Grid_to_Grid1/

    everything works fine at client side, but I noticed that the records added to the grid via drag drop are not marked as dirty; when I get the grid records in code behind using the
    store ChangedData as parameter to deserialize into my object, the ChangedData is empty.

    There is something I should set to the added/removed records to obtain the usual behaviour?

    Thanks in advance.
  2. #2
    Hi,

    I am unable to reproduce the problem.

    I have drop a row from the left on the right and call the GridPanel2 Store save method in the console. I see
    submitDirectEventConfig {
        "config": {
            "serviceParams": "{\"Updated\":[{\"Name\":\"Rec 2\",\"Column1\":\"2\",\"Column2\":\"2\",\"id\":-3}]}"
        }
    }
    in the request.

    It means that a just dropped row is sent to a server as an update one and must be available in ChangedData.

    You can force that row to be considered as a new one ("Created" instead of "Update") if mark as a newRecord.
    record.newRecord = true;
    store.add(record);
    Hope this helps.
  3. #3
    Hi Daniil,
    I resolved the problem weeks ago... so I m not sure how I did it :)
    Anyway, if I remember, to allow the dragged records to be included in the Changed Data collection, I just modified the code this way:
    instead of:
    Quote Originally Posted by Daniil View Post
    You can force that row to be considered as a new one ("Created" instead of "Update") if mark as a newRecord.
    record.newRecord = true;
    store.add(record);
    I just wrote this:

    store.add(record.data);
    This solved the problem; I did not check further because of other deadlines incoming :)

    btw, I will make some test to check your suggestion, because it sounded strange to me also, that the record was not in the changed data collection.

    Many thanks again!!
  4. #4
    I bookmarked that thread when saw at the first time to answer later. Then the deadlines has covered me as well:)

    Anyways, apologize for the delayed answer.
  5. #5
    No problem Daniil,
    always appreciate your help :)

Similar Threads

  1. [CLOSED] Drag & Drop Between Dynamic grids
    By imaa in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Dec 05, 2011, 12:34 PM
  2. Replies: 5
    Last Post: Jun 14, 2011, 11:47 AM
  3. [CLOSED] Drag and Drop between grids
    By Stefanaccio in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 01, 2010, 10:58 AM
  4. drag and drop between tow grids
    By simbal in forum 1.x Help
    Replies: 2
    Last Post: Apr 26, 2009, 8:36 PM
  5. [CLOSED] Added Records don't show up as modified
    By Dave.Sanders in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Nov 21, 2008, 6:54 AM

Tags for this Thread

Posting Permissions