Upgrade from v9 to v11 - missing api reference

Posted by: jkainth on 28 December 2017, 1:25 am EST

    • Post Options:
    • Link

    Posted 28 December 2017, 1:25 am EST

    Hey

    We’re making the move from v9 to v11.

    We are using floating objects and in v9 there was ```

    sheet.addFloatingObjectKeyMap

    
    This addFloatingObjectKeyMap is missing in v11.
    I can see that the equivalent for cells ```
    sheet.addKeyMap
    ``` went missing too but was added in the migration.js file.
    
    Please advice how we can get that functionality back. An updated migration.js?
  • Posted 28 December 2017, 10:28 pm EST

    Hello,

    If you want to continue using the same code, you can use themigration.js file for backward compatibility. The file is located at following location in downloaded SpreadJS folder:

    …\SpreadJS.Release.11.0.0\Spread.Sheets\Spread.Sheets.Release.11.0.0\scripts\interop

    Thanks,

    Deepak Sharma

  • Posted 30 December 2017, 2:02 am EST

    Sorry I want clear.

    We are using the migration file. It only has support for ```

    sheet.addKeyMap

    
    The migration file does not have support for ```
    sheet.addFloatingObjectKeyMap
    ```.  Causing our app to blow up. 
    
    What is the equivalent of this method in v11?
  • Posted 2 January 2018, 4:09 pm EST

    Hello,

    I have asked the concerned team about this. I will let you know once I get an update on this.

    The tracking id for this issue is :252268

    Regards,

    Deepak Sharma

  • Posted 4 January 2018, 1:45 am EST

    How do i track the issue?

    Is there a link to the issue/ticket i could follow and keep an eye out?

  • Posted 4 January 2018, 5:31 pm EST

    Hello,

    The tracking id is given for your reference only. We will check the status of the issue with the given tracking id and inform you accordingly.

    Thanks,

    Deepak Sharma

  • Posted 30 January 2018, 12:45 am EST

    Hi Deepak,

    we are also using addkeymap extensively and we are under migration from v9 to v11.

    we don’t want to use migration script, so What is the alternate and best way to achieve same functionality of addkeymap in v11?

  • Posted 31 January 2018, 2:18 am EST

    Hello,

    Developer suggested that you can use the register method to do the same thing.

    http://help.grapecity.com/spread/SpreadSheets11/webframe.html#SpreadJS~GC.Spread.Commands.CommandManager~register.html

    The method addFloatingObjectKeyMap is similar to the method addKeyMap, and these two methods are replaced by the register method.

    The method addFloatingObjectKeyMap is a private API, so the migration.js doesn’t contain it.

    With migration.js, you could use addKeyMap and the register method.

    If you do not use migration.js, you could use the register method only.

    Thanks,

    Deepak Sharma

  • Posted 31 January 2018, 11:42 pm EST

    Hi Deepak,

    I gave it a try with register method, but I don’t see there is any command name (2nd param for register function) related to keypress.

    Let me explain you in detail. we are using addkeymap in v9 for listening to keyboard events. as below:

    // 113 is the keycode that refers to ‘F2’

    sheet.addKeyMap(113, false, false, false, false, function () {

    sheet.startEdit();

    });

    so, in the sheet area, when user presses F2, callback function that was bound above was being called.

    Now, we want to acheive same thing in V11. As suggested by you, when I want to use register method it is expecting following params:

    (name, command, key, ctrl, shift, alt, meta)

    where name refers to command name, which are mentioned in: http://help.grapecity.com/spread/SpreadSheets11/SpreadJS~GC.Spread.Sheets.Commands.html

    but, there is no command that is related to keypress.

    How to achieve our desired behavior in V11?

    Note: I even tried with migration script, but above functionality is not working as there is no appropriate command associated with this action.

  • Posted 2 February 2018, 1:41 am EST

    Hello,

    You can register the command for any key and then call your function through that command. Please have a look at the sample application attached.

    Thanks,

    Deepak Sharma

    SpreadJSKeyMap.zip

  • Posted 4 February 2018, 8:51 pm EST

    Thanks deepak, this looks good. This is exactly what i was looking for.

    But, I have a concern, which is:

    I dont want to allow CTRL+SHIFT+END action on my sheet. So in V9 we wrote a addkeymap on CTRL+SHIFT+END and returned false. But now, when I try to do same thing with your approach. it is not working. Can you let me know where am I going wrong?

    Please find the attachment for the same:SpreadJSKeyMap - v11.zip

  • Posted 5 February 2018, 8:40 pm EST

    Hi Viswanath,

    You can use the code as follows to handle the Ctrl+Shift+End keys:

    spread.commandManager().setShortcutKey(undefined, GC.Spread.Commands.Key.end, true, true, false, false);

    Thanks,

    Deepak Sharma

  • Posted 5 February 2018, 10:30 pm EST

    Thanks that worked :slight_smile:

Need extra support?

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

Learn More

Forum Channels