Zum Hauptinhalt springen

beforeClear

Vorsicht

The beforeClear event was deprecated in v4.3. It still works, but you should apply the new approach:

spreadsheet.events.on("beforeAction", (actionName, config) => {
if (actionName === "clear") {
console.log(actionName, config);
return false;
}
});

For more details about the new concept, see Spreadsheet-Aktionen.

Beschreibung

Wird ausgelöst, bevor eine Tabellenkalkulation geleert wird

Verwendung

beforeClear: () => void | boolean;

Rückgabewert

Geben Sie false zurück, um das Leeren einer Tabellenkalkulation zu verhindern; andernfalls true.

Beispiel

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

// subscribe on the "beforeClear" event
spreadsheet.events.on("beforeClear", function(){
console.log("A spreadsheet will be cleared");
return false;
});

Changelog: Hinzugefügt in v4.2

Verwandter Artikel: Event-Handling