If we have space in sheet Name ,cut paste does not work

Posted by: Shalini89garg on 21 May 2018, 12:10 am EST

    • Post Options:
    • Link

    Posted 21 May 2018, 12:10 am EST

    Hi ,

    I am having space in sheet name ,and cut paste is not working.

    could you please help on this.

    run the attached code.

    click on test2 (#) and add formula in day1 referencing sheet 1 like SUM(‘Test(#)’!C2:D2)

    now in sheet2 on formula cell ,press ctrl +X and paste at any other cell.

    It shows 0 .

    when we double click and come out ,

    it calculate formula

    SpreadJSCut Issue - Copy.zip

  • Posted 22 May 2018, 12:23 am EST

    Hello,

    You can handle the ClipboardPasted event and call recalcAll() method.

    
    activeSheet.bind(GC.Spread.Sheets.Events.ClipboardPasted, function (sender, args) {
        activeSheet.recalcAll();
    });
    
    
  • Posted 22 May 2018, 12:41 am EST

    Hello Deepak,

    I tried this, It doesnt solve the issue. Still after cut paste value is 0 and when we double click its showing correct value

  • Posted 22 May 2018, 5:54 pm EST

    Hi Shalini,

    I am not able to replicate this issue at my end. Please have a look at the attached video.

    Also I would suggest you to use the latest version of SpreadJS v11.1.1.

    Thanks,

    Deepak SharmaFormulaCutPaste.zip

  • Posted 22 May 2018, 10:56 pm EST

    Hi Deepak,

    I watched the video shared by you on link.

    I am able to reproduce this issue.

    After selecting formula , are you pressing Ctrl +X and then pasting by Ctrl +V or not,

    I am saying this because in MY code we have disabled Ctrl +X and when we press on Ctrl +X ,it doesn’t remove value from that cell but in your video its removing. For Us Ctrl +X should behave like Ctrl +C

  • Posted 24 May 2018, 12:22 am EST

    Hi Shalini,

    The formula(“=‘Test (#)’!C2”) gives #REF on pasting in another cell which means that the reference is incorrect. However the same formula works fine when pasted using Ctrl +C.

    May I know why do you need the Ctrl+X to work like Ctrl+C?

    Thanks,

    Deepak Sharma

  • Posted 27 May 2018, 10:38 pm EST

    The original requirement was to have the option to disable the Cut and paste . We find the way to replace the cut and paste with copy paste like work around.

    We want to disable the cut and paste by tab. Because if we allow this creates an inconsistency in the total column.

    So when some user , used the cut and paste (ctrl + x) , all the reference included in that cell (formulas) was lost after use that ctrl + x and paste , so to avoid that we (red circle reference error) we include the functionality that ctrl + x works as equal than copy paste (ctrl + c).

    Finally and to summarize we want that ctrl + x works as copy and paste just to avoid a user broke his own formulas or cell.

  • Posted 28 May 2018, 5:06 pm EST

    Hi Shalini,

    You need to unbind the Ctrl+X and then bind it to ‘copy’ command. Here is the code to do that:

    
     spread.bind(GC.Spread.Sheets.Events.ActiveSheetChanged, (e, args) => {
                    const index = spread.getActiveSheetIndex();
                    const sheet = spread.getSheet(index);
                    spread.commandManager().setShortcutKey(undefined, GC.Spread.Commands.Key.x, true, false, false, false);
                    spread.commandManager().setShortcutKey('copy', GC.Spread.Commands.Key.x, true, false, false, false);
                });
    
    

    I have modified the sample , please refer to the attachment.

    Thanks,

    Deepak Sharma

    SpreadJSCut Issue -Updated.zip

Need extra support?

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

Learn More

Forum Channels