Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 1.42 KB

File metadata and controls

54 lines (38 loc) · 1.42 KB
sidebar_label afterSheetClear
title afterSheetClear event
description You can learn about the afterSheetClear event in the documentation of the DHTMLX JavaScript Spreadsheet library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Spreadsheet.

afterSheetClear

:::caution The afterSheetClear event has been deprecated in v4.3. The event will continue work, but you'd better apply a new approach:

spreadsheet.events.on("afterAction", (actionName, config) => {
    if (actionName === "clearSheet") {
        console.log(actionName, config);
    }
});

For more details about the new concept, see Spreadsheet actions. :::

Description

@short: Fires after a sheet of the spreadsheet is cleared

Usage

afterSheetClear: (sheet: object) => void;

Parameters

The callback of the event takes the following parameters:

  • sheet - (required) an object with the name and id of a sheet

Example

const spreadsheet = new dhx.Spreadsheet("spreadsheet", {});
spreadsheet.parse(data);

// subscribe on the "afterSheetClear" event
spreadsheet.events.on("afterSheetClear", function(sheet){
    console.log("The " + sheet.name + " is cleared");
    console.log(sheet);
});

Changelog: Added in v4.2

Related articles: Event handling