blockly > Block > setDeletable
Block.setDeletable() method
Set whether this block is deletable or not.
Signature:
setDeletable(deletable: boolean): void;
Parameters
Parameter |
Type |
Description |
deletable |
boolean |
True if deletable. |
Returns:
void
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `setDeletable()` method controls whether a block can be deleted by the user."],["It takes a single boolean argument, `deletable`, which is true if the block should be deletable and false otherwise."],["Calling this method with `true` allows the block to be deleted, while calling it with `false` prevents deletion."]]],["The `setDeletable()` method determines if a block can be deleted. It accepts a single boolean parameter, `deletable`. If `deletable` is set to `true`, the block can be deleted. Otherwise, the block cannot be deleted. The method returns no value (`void`). This method changes the deletable status of the block.\n"]]