Detect Table creation/deletion with events

Posted by: jeff on 8 November 2019, 10:52 am EST

  • Posted 8 November 2019, 10:52 am EST

    Where are the events for table creation/deletion?

    By Table I mean:
    https://help.grapecity.com/spread/SpreadJSWeb/JavascriptLibrary~GcSpread.Sheets.Sheet~addTable.html
  • Replied 10 November 2019, 7:39 pm EST

    Hi Jeff,
    The table does not any event handler for this.
    However, since the table is added/removed by code, hence the table creation and deletion can be detected and logged using code as the add/ remove method is called.

    Regards,
    Manish Gupta
  • Replied 11 November 2019, 12:22 pm EST

    A user can highlight a whole table and press the delete key. This deletes the table. Hence I need an event handler.
  • Replied 12 November 2019, 4:29 pm EST

    Hi Jeff,

    Thank you for the additional information. We could confirm that currently there is no event prevent to handle this scenario and hence we have created an enhancement request to add events for table deletion. Internal tracking Id for the issue is SJS-2571.
    Further, could you please explain some more about your use case that why you need to handle table deletion? That would help us to better understand the scenario.

    Regards
    Sharad
  • Replied 21 November 2019, 4:09 pm EST

    I'm binding tables to a data source. I need to know when a person deletes a table and when a person deletes a column/row in a table.
  • Replied 21 November 2019, 4:59 pm EST

    Frankly tables should have a 1) Create, 2) Delete, 3) Insert Column, 4)Insert Row, 5)Change Value, 6) Change Range.

    You should be able to set a listener on a single table or all tables in the workbook/sheet.

    I need to know. When a col is deleted, when a table is deleted.

  • Replied 24 November 2019, 7:59 pm EST

    Hi Jeff,

    Thank you for the additional info. We have forwarded it to the dev team.
    For row/column insert/delete, we have added TableRowsChanged, TableColumnsChanged events in v13 API, for change range you could handle TableResized event.
    Please refer to the following documents:
    • TableColumnsChanged Event: https://www.grapecity.com/spreadjs/docs/v13/online/SpreadJS~GC.Spread.Sheets.Events~TableColumnsChanged_EV.html
    •TableRowsChanged Event: https://www.grapecity.com/spreadjs/docs/v13/online/SpreadJS~GC.Spread.Sheets.Events~TableRowsChanged_EV.html
    • TableResized Event: https://www.grapecity.com/spreadjs/docs/v13/online/SpreadJS~GC.Spread.Sheets.Events~TableResized_EV.html

    Regards
  • Replied 6 December 2019, 11:19 pm EST

    Cool,

    I would love to have the full suite of events.
  • Replied 5 February 2020, 10:27 am EST

    Any progress on this?
  • Replied 5 February 2020, 5:53 pm EST

    Hi Jeff,

    This case is still with the dev team. I've asked the team for an update and will let you know as soon as I get an update.
  • Replied 23 February 2020, 3:12 pm EST

    Thanks
  • Replied 25 February 2020, 3:14 pm EST

    Hi Jeff,

    Till now, It is planned to add this feature in our V13 SP1 release(13.1.0). We will let you know in if it changes.

    Regards
  • Replied 1 March 2020, 7:22 am EST

    Awesome thanks!
  • Replied 2 March 2020, 3:53 pm EST

    Sarad,

    This is slight bug.

    1) Make the alert appear
    2) Click on any cell in the grid
    3) Notice cell highlighting and cell selection is broken.

  • Marked as Answer

    Replied 3 March 2020, 3:54 pm EST

    Hi Jeff,

    Upon further investigation, we found a better solution to achieve the required functionality, please refer to the following sample and let us know if the issue persists:
    https://codesandbox.io/s/spread-js-starter-egfvs
  • Replied 4 March 2020, 12:01 pm EST

    Cool the above comment is in reference to -> https://www.grapecity.com/forums/spread-sheets/accidental-keystrokes-end-
  • Replied 23 April 2020, 10:08 pm EST

    Hi Jeff,

    We have added the support to detect table deletion in v13.1.0. Now we could handle the RangeChanged event to detect table deletions. Refer to the following code snippet:
    spread.bind(GC.Spread.Sheets.Events.RangeChanged, (e, args) => {
    if(args.GC.Spread.Sheets.RangeChangedAction.clear){
    let deletedTables = args.tableNames;
    }
    });

    Please update to the latest version and let us know if you face any issues. You may get the latest build from npm or download using the following link:
    http://cdn.grapecity.com/spreadjs/13.1.0/Files/SpreadJS.Release.13.1.0.zip

    Regards
Need extra support?

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

Learn More

Forum Channels