Initializes a new instance of the DataTable.
The HTMLTableElement or a CSS selector string for the table.
List of ColumnOptions for the table.
Optional configuration options for the DataTable.
Gets the underlying data
Gets the currently filtered and sorted rows displayed in the table.
Gets the underlying HTMLTableElement managed by this DataTable instance.
Gets the current options applied to the table.
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
Optionaloptions: boolean | AddEventListenerOptionsClears the current message and dispalsy the normal table data.
Deletes a row at a specific original index from the table.
The original index of the row to delete.
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
Export the current visible table data to a CSV file.
The name of the file to save.
If true, exports all original data (ignoring filters). If false (default), exports only the currently visible (filtered and sorted) rows.
Applies filters to the table rows.
Filters can be an object where keys are field names and values are the criteria to filter by,
or a callback function that receives a row and its index and returns true if the row should be included.
Optionalfilters: null | FilterCallback<T> | Partial<{ [K in string]: any }>An object defining field-based filters or a custom filter callback function.
Gets the current state of the table.
Hides a visible column.
The field name of the column to hide.
Finds the original index of the first row where the specified field matches the given value. This searches through the original, unfiltered dataset.
The field name within the row data to search.
The value to match against the field's content.
The original index of the found row, or -1 if no match is found.
Loads data into the table
An array of data to be loaded
Configuration for the load operation
Refreshes the table display. This re-applies filters, sorting, and updates headers and rows.
Removes the event listener in target's event listener list with the same type, callback, and options.
Optionaloptions: boolean | EventListenerOptionsRestores the table to the provided state.
The state to restore the table to.
Scrolls the table to bring the row at the specified original index into view.
The original index of the row (from the initial dataset).
Filters rows based on a search query.
The search is performed on columns marked as searchable and extraSearchFields.
Optionalquery: null | string | RegExpThe search term (string) or a regular expression. An empty string clears the search.
Sets the display order of the columns in the table.
An array of field names representing the new order of columns. Columns not included in the array will be placed at the end.
Sets the visibility of a specified column.
The field name of the column.
true to show the column, false to hide it.
Shows a previously hidden column.
The field name of the column to show.
Displays a message in the table body, typically used for "no data" or "no results" states. The message is shown in a single row spanning all columns.
The text or HTML message to display.
A string or array of strings for CSS classes to apply to the message row.
Sorts the table by a specified column and order.
If order is null, the sort on this column is removed.
The field name of the column to sort by.
The sort order: 'asc', 'desc', or null to remove sorting for this column.
Updates the data of a row at a specific original index.
The original index of the row to update.
An object containing the new data to assign to the row. Existing fields will be updated, and new fields will be added.
Executes a callback function without triggering table updates (like re-rendering or event dispatches) until the callback has completed. This is useful for batching multiple operations.
Represents a dynamic and interactive table with features like sorting, searching, filtering, column resizing, column rearranging, and virtual scrolling.
Example