gridstack_destroy
Remove a GridStack.js dashboard layout instance from the DOM, optionally deleting all associated HTML elements to clean up resources.
Instructions
Destroy the grid instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| removeDOM | No | Remove DOM elements |
Implementation Reference
- src/tools/index.ts:460-473 (registration)Registration of the gridstack_destroy tool in the listTools() method, including name, description, and input schema.{ name: "gridstack_destroy", description: "Destroy the grid instance", inputSchema: { type: "object", properties: { removeDOM: { type: "boolean", description: "Remove DOM elements", default: false, }, }, }, },
- src/tools/index.ts:813-814 (registration)Dispatch registration in the callTool switch statement that maps gridstack_destroy calls to the destroy handler method.case "gridstack_destroy": return this.destroy(args as DestroyParams);
- src/tools/index.ts:1034-1041 (handler)The handler function for gridstack_destroy that generates JavaScript code to destroy the GridStack instance, optionally removing DOM elements.private async destroy(params: DestroyParams): Promise<string> { const { removeDOM = false } = params; return this.utils.generateGridStackCode("destroy", { removeDOM, code: `grid.destroy(${removeDOM});`, }); }