Paste between workbook

Posted by: ngocnguyen09910060 on 16 October 2022, 2:03 pm EST

  • Posted 16 October 2022, 2:03 pm EST

    Hi teams,

    On my application, my customer want to display 2 SpreadJS to show 2 type of data. On SpreadJS1, we have 1 merged cell:

    sheet.addSpan(0, 0, 2, 1);

    Now, i perform copy/paste actions between 2 SpreadJS:

    1. On SpreadJS1, select merged cell A1 (text “ABC”) and Ctrl + C.
    2. On SpreadJS1, select single cell B1 and Ctrl + V => B1 & B2 will be merged with text “ABC”.
    3. On SpreadJS2, select single cell A1 (text “ABC”) and Ctrl + C.
    4. On SpreadJS1, select single cell C1 and Ctrl + V => C1 & C2 will be merged with text “ABC”.
    5. On SpreadJS2, select single cell B1 (text “DEF”) and Ctrl + C.
    6. On SpreadJS1, select single cell D1 and Ctrl + V => D1 will be pasted with text “DEF”.

    On the above steps, i see that step 3-4 and step 5-6 have the same behavior but result is different.

    I think result of step 5-6 is correct.

    On step 4, i think the right result is: C1 & C2 won’t be merged.

    But, windows clipboard seem to have not been changed and data is pasted is data from step 1.

    Please check my sample source code and give me an explaintation.

    SpreadJS_PasteBetweenTwoSpreadJS.zip

  • Posted 18 October 2022, 6:41 am EST

    Hi,

    Thank you for providing such thorough instructions and the sample.

    I can observe the same problem with SpreadJS V15.2.3, the most recent version.

    I’ve sent this along to the development team for them to look into further. This has the following internal tracking id: SJS-15099. When I have new information for you, I’ll let you know.

    Regards

    Ankit

  • Posted 24 October 2022, 1:26 am EST

    Hi,

    This is a SpreadJS limitation, according to the devs.

    The fundamental justification is how to determine whether SpreadJS should perform internal or external paste.

    Let’s say,

    1. I copy “A” in spreadjs with Ctrl+C

    2. Internal clipboard content “A”

    3. External clipboard content “A”

    4. Then I copy “B” outside (some where like in excel or notepad).

    5. External clipboard content “B” → at this point, spreadjs didn’t know.

    6. Then I pasted in spreadjs, at this point, both the internal clipboard and external clipboard have content. (A and B )

    Result: The internal logic will judge the external and internal clipboard content, they are not the same, the external clipboard has higher priority, and do the external pasting, “B” is pasted into the cell.

    Your scenario:

    1. After #1, internal “ABC”, external “ABC”

    2. In #2, judge as an internal paste behavior, both the span and content pasted from source range to target range.

    3. After #3, the ss1 spread internal “ABC”, the external “ABC”

    4. After #4, content is the same, judge as an internal paste behavior, both the span and content pasted from the ss1 source range to the target range.

    5. After #5, the ss1 spread internal “ABC”, the external “DEF”.

    6. After #6, judge as an external paste behavior, only the “DEF” content pasted from the external clipboard to the target range.

    This is the whole process.

    Workaround:

    Before #4, press “ESC” in ss1, it will clear the internal clipboard. then in #5, the ss1 spread internal is empty, and the external is “ABC”.

    After #6, judge as an external paste behavior, the “ABC” content pasted from the external clipboard to the target range only.

    Regards,

    Ankit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels