telerik grid destroy table
- Published
- Reading time
- 1 min read
- Length
- 142 words
On this page
Telerik Grid Destroy Table#
If you're working with Telerik Grid, you might need to destroy the table at some point. This is useful if you want to clear the table and start fresh. Here are a few ways to do it:
Using jQuery#
If you're using jQuery, you can simply remove the table element from the DOM:
$('table#telerik-grid-id').remove();Using the Telerik Grid API#
If you're using Telerik Grid, you can use the destroy method provided by the API:
var grid = $("#telerik-grid-id").data("kendoGrid");
grid.destroy();This will remove the grid instance and all associated elements from the DOM.
Using plain JavaScript#
If you prefer to use plain JavaScript, you can remove the table element using the removeChild method:
var table = document.getElementById("telerik-grid-id");
table.parentNode.removeChild(table);This will remove the table element and all its contents from the DOM.