Stay organized with collections
Save and categorize content based on your preferences.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eThe \u003ccode\u003esetDeletable()\u003c/code\u003e method controls whether a block can be deleted by the user.\u003c/p\u003e\n"],["\u003cp\u003eIt takes a single boolean argument, \u003ccode\u003edeletable\u003c/code\u003e, which is true if the block should be deletable and false otherwise.\u003c/p\u003e\n"],["\u003cp\u003eCalling this method with \u003ccode\u003etrue\u003c/code\u003e allows the block to be deleted, while calling it with \u003ccode\u003efalse\u003c/code\u003e prevents deletion.\u003c/p\u003e\n"]]],["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"],null,["[blockly](./blockly.md) \\\u003e [Block](./blockly.block_class.md) \\\u003e [setDeletable](./blockly.block_class.setdeletable_1_method.md)\n\nBlock.setDeletable() method\n---------------------------\n\nSet whether this block is deletable or not.\n\n**Signature:** \n\n setDeletable(deletable: boolean): void;\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|-----------|---------|--------------------|\n| deletable | boolean | True if deletable. |\n\n**Returns:**\n\nvoid"]]