API
DataTables has an extensive API which can be used to access the data contained in a table and otherwise manipulate the table after the table initialisation has completed. The DataTables API is designed to reflect the structure of the data in the table and how you will typically interact with the table through the API. It can also be extended by the extensions and plug-ins providing additional features and operations.
The API can be accessed through the following methods:
new DataTable.Api( selector );
$( selector ).DataTable();
$( selector ).dataTable().api();
The result from each is an instance of the DataTables API object which has the tables found by the selector in its context. If you are using jQuery, it is important to note the difference between $( selector ).DataTable()
and $( selector ).dataTable()
. The former returns a DataTables API instance, while the latter returns a jQuery object.
For general information on how the DataTables API operates, including its chaining, how to work with multiple tables and definitions of the terminology used in this reference, please prefer to the API manual.
Library | Name | Summary |
---|---|---|
DataTables - Core | Perform a jQuery selection action on the full table. | |
DataTables - Core | Namespace for Ajax methods | |
DataTables - Core | Get the latest JSON data obtained from the last Ajax request DataTables made | |
DataTables - Core | Get the data submitted by DataTables to the server in the last Ajax request | |
DataTables - Core | Reload the table data from the Ajax data source | |
DataTables - Core | Get / set the URL that DataTables uses to Ajax fetch data | |
DataTables - Core | Load data from the newly set data source URL | |
DataTables - Core | Clear the table of all data. | |
DataTables - Core | Get the initialisation options for a column. | |
DataTables - Core | Get / set a named search to apply to a column. | |
DataTables - Core | Get the initialisation options for the selected columns. | |
DataTables - Core | Get / set a named search to apply to a column. | |
DataTables - Core | Get the data for the whole table. | |
DataTables - Core | Destroy the DataTables in the current context. | |
DataTables - Core | Redraw the table. | |
DataTables - Core | Internationalisation token lookup. | |
DataTables - Core | Get the initialisation options used for the table. | |
DataTables - Core | Table events removal. | |
DataTables - Core | Table events listener. | |
DataTables - Core | Listen for a table event once and then remove the listener. | |
DataTables - Core | Get / set the ordering applied to the table. | |
DataTables - Core | Get / set the fixed ordering applied to the table. | |
DataTables - Core | Add an ordering listener to an element, for a given column. | |
DataTables - Core | Get / set the current page of the table. | |
DataTables - Core | Get paging information about the table | |
DataTables - Core | Get / set the table's page length. | |
DataTables - Core | Set the processing indicator state for the DataTable. | |
DataTables - Core | Search for data in the table. | |
DataTables - Core | Get / set a named search to apply to a table. | |
DataTables - Core | Obtain the table's settings object | |
DataTables - Core | Get / set the state of the table | |
DataTables - Core | Clear the saved state of the table. | |
DataTables - Core | Get the table state that was loaded during initialisation. | |
DataTables - Core | Trigger a state save. | |
DataTables - Core | Trigger an event. | |
DataTables - Cells | Select a single cell from a table. | |
DataTables - Cells | Get the DataTables cached data for the selected cell | |
DataTables - Cells | Get / set data for the selected cell | |
DataTables - Cells | Get index information about the selected cell | |
DataTables - Cells | Invalidate the data held in DataTables for the selected cells | |
DataTables - Cells | Get the DOM element for the selected cell | |
DataTables - Cells | Get rendered data for a cell | |
DataTables - Cells | Select multiple cells from a table. | |
DataTables - Cells | Get the DataTables cached data for the selected cells | |
DataTables - Cells | Get data for the selected cells | |
DataTables - Cells | Iterate over each selected cell, with the function context set to be the cell in question. | |
DataTables - Cells | Get index information about the selected cells | |
DataTables - Cells | Invalidate the data held in DataTables for the selected cells | |
DataTables - Cells | Get the DOM elements for the selected cells | |
DataTables - Cells | Get rendered data for a collection of cells | |
DataTables - Columns | Select a single column from a table. | |
DataTables - Columns | Get the DataTables cached data for the selected column. | |
DataTables - Columns | Get the data for the cells in the selected column. | |
DataTables - Columns | Get the data source property for the selected column. | |
DataTables - Columns | Get the footer node for the selected column. | |
DataTables - Columns | Get the header node for the selected column. | |
DataTables - Columns | Get the column index of the selected column. | |
DataTables - Columns | Get the cell nodes for the selected column. | |
DataTables - Columns | Order the table by the selected column. | |
DataTables - Columns | Get information about the orderable status of a column. | |
DataTables - Columns | Get rendered data for a column | |
DataTables - Columns | Search for data in the selected column. | |
DataTables - Columns | Get / set the title for a column. | |
DataTables - Columns | Get a column's data type. | |
DataTables - Columns | Get / set the visibility of a single selected column. | |
DataTables - Columns | Get the width of a column. | |
DataTables - Columns | Convert between column index formats | |
DataTables - Columns | Select multiple columns from a table. | |
DataTables - Columns | Get the DataTables cached data for the selected columns. | |
DataTables - Columns | Get the data for the cells in the selected columns. | |
DataTables - Columns | Get the data source property for the selected columns. | |
DataTables - Columns | Iterate over each selected column, with the function context set to be the column in question. | |
DataTables - Columns | Get the footer nodes for the selected columns. | |
DataTables - Columns | Get the header node for the selected columns. | |
DataTables - Columns | Get the column indexes of the selected columns. | |
DataTables - Columns | Get the cell nodes for the selected columns. | |
DataTables - Columns | Order the table by the selected columns. | |
DataTables - Columns | Get information about the orderable status of the selected columns. | |
DataTables - Columns | Get rendered data for a collection of columns | |
DataTables - Columns | Search for data in the selected columns. | |
DataTables - Columns | Get / set the title for multiple columns. | |
DataTables - Columns | Get the data types for selected columns. | |
DataTables - Columns | Get / set the visibility of the selected columns. | |
DataTables - Columns | Get the widths of a group of columns. | |
DataTables - Columns | Recalculate the column widths | |
DataTables - Rows | Select a single row from a table. | |
DataTables - Rows | Get the DataTables cached data for the selected row. | |
DataTables - Rows | Row child method namespace | |
DataTables - Rows | Get / set the child rows of the selected main table row | |
DataTables - Rows | Hide child rows after creating new child rows | |
DataTables - Rows | Destroy child row(s) for the selected parent row | |
DataTables - Rows | Make newly defined child rows visible | |
DataTables - Rows | Hide the child row(s) of a parent row | |
DataTables - Rows | Check if the child rows of a parent row are visible | |
DataTables - Rows | Destroy child row(s) for the selected parent row | |
DataTables - Rows | Make the child row(s) of a parent row visible | |
DataTables - Rows | Get / set the data for the selected row. | |
DataTables - Rows | Get the id of the selected row. | |
DataTables - Rows | Get the row index of the selected row. | |
DataTables - Rows | Invalidate the data held in DataTables for the selected row | |
DataTables - Rows | Get the row | |
DataTables - Rows | Delete the selected row from the DataTable. | |
DataTables - Rows | Add a new row to the table. | |
DataTables - Rows | Select multiple rows from a table. | |
DataTables - Rows | Get the DataTables cached data for the selected rows. | |
DataTables - Rows | Get the data for the selected rows. | |
DataTables - Rows | Iterate over each selected row, with the function context set to be the row in question. | |
DataTables - Rows | Get the ids of the selected rows. | |
DataTables - Rows | Get the row indexes of the selected rows. | |
DataTables - Rows | Invalidate the data held in DataTables for the selected rows | |
DataTables - Rows | Get the row | |
DataTables - Rows | Delete the selected rows from the DataTable. | |
DataTables - Rows | Add multiple new rows to the table. | |
DataTables - Tables | Get / set the table's caption | |
DataTables - Tables | Get the table's | |
DataTables - Tables | Select a table based on a selector from the API's context | |
DataTables - Tables | Get the | |
DataTables - Tables | Get the | |
DataTables - Tables | Get the | |
DataTables - Tables | Get a Javascript representation of the table footer structure | |
DataTables - Tables | Get the | |
DataTables - Tables | Get a Javascript representation of the table header structure | |
DataTables - Tables | Get the | |
DataTables - Tables | Select tables based on a selector from the API's context | |
DataTables - Tables | Get the | |
DataTables - Tables | Get the | |
DataTables - Tables | Get the | |
DataTables - Tables | Get the | |
DataTables - Tables | Get the | |
DataTables - Utility | Determine if there are any entries in the result set | |
DataTables - Utility | Get the number of elements that are contained in an API instance | |
DataTables - Utility | Iterate over the contents of the API result set. | |
DataTables - Utility | Reduce an Api instance to a single context and result set. | |
DataTables - Utility | Trigger an error message. | |
DataTables - Utility | Create a new API instance with all elements from the result set which pass a given test. | |
DataTables - Utility | Flatten a 2D array structured API instance to a 1D array structure. | |
DataTables - Utility | Get the underlying data from a DataTable instance | |
DataTables - Utility | Determine if an API result set contains a given value. | |
DataTables - Utility | Find the first instance of a value in the API instance's result set. | |
DataTables - Utility | Iterate over a result set of table, row, column or cell indexes | |
DataTables - Utility | Join the elements in the result set into a string. | |
DataTables - Utility | Find the last instance of a value in the API instance's result set. | |
DataTables - Utility | Number of elements in an API instance's result set. | |
DataTables - Utility | Create a new API instance with the result set defined by the values returned from the callback function. | |
DataTables - Utility | Create a new API instance with the value of a property from the objects in the current result set. | |
DataTables - Utility | Remove the last item from an API instance's result set. | |
DataTables - Utility | Add one or more items to the end of an API instance's result set. | |
DataTables - Utility | Determine if a DataTable is ready. | |
DataTables - Utility | Apply a callback function against and accumulator and each element in the Api's result set (left-to-right). | |
DataTables - Utility | Apply a callback function against and accumulator and each element in the Api's result set (right-to-left). | |
DataTables - Utility | Reverse the result set of the API instance. | |
DataTables - Utility | Remove the first item from an API instance's result set. | |
DataTables - Utility | Create an independent copy of the API instance. | |
DataTables - Utility | Sort the elements of the API instance's result set. | |
DataTables - Utility | Modify the contents of an Api instance's result set, adding or removing items from it as required. | |
DataTables - Utility | Convert the API instance to a jQuery object, with the objects from the instance's result set in the jQuery result set. | |
DataTables - Utility | Create a native Javascript array object from an API instance. | |
DataTables - Utility | Convert the API instance to a jQuery object, with the objects from the instance's result set in the jQuery result set. | |
DataTables - Utility | Create a new API instance containing only the unique items from the elements in an instance's result set. | |
DataTables - Utility | Add one or more items to the start of an API instance's result set. | |
DataTables - Static | Register a date / time format for DataTables to use | |
DataTables - Static | Create a new feature that can be used for layout | |
DataTables - Static | Check is a table node is a DataTable or not | |
DataTables - Static | Get all DataTables on the page | |
DataTables - Static | Get / set details of a data type | |
DataTables - Static | Get a list of the data types registered | |
DataTables - Static | Wait for a timeout before calling a function | |
DataTables - Static | Normalise diacritic characters in a string. | |
DataTables - Static | Escape HTML entities to make a user input string safe | |
DataTables - Static | Escape special characters in a regular expression string | |
DataTables - Static | Create a read function from a descriptor | |
DataTables - Static | Create a write function from a descriptor | |
DataTables - Static | Remove HTML from a string | |
DataTables - Static | Throttle the calls to a method to reduce call frequency | |
DataTables - Static | Get all unique items from an array | |
DataTables - Static | Version number compatibility check function | |
AutoFill | Disable AutoFill's interactions | |
AutoFill | Enable or disable AutoFill's interactions | |
AutoFill | Determine if AutoFill is enabled or disabled | |
Buttons | Save a file that has been created on the client-side | |
Buttons | Select a single button | |
Buttons | Get / set the action function for the selected button | |
Buttons | Get / set the active state of the selected button | |
Buttons | Create a new button and add it to the document | |
Buttons | Rebuild a buttons collection | |
Buttons | Disable the selected button | |
Buttons | Enable / disable the selected button | |
Buttons | Get the index of a node | |
Buttons | Get the button node for the selected button | |
Buttons | Show popover box for a button, allowing extra user input | |
Buttons | Get / set the processing state for a button | |
Buttons | Remove and delete the selected button | |
Buttons | Get / set the text for the selected button | |
Buttons | Trigger the action of the selected button | |
Buttons | Select one or more buttons | |
Buttons | Get / set the action functions for the selected buttons | |
Buttons | Set the active state for the selected buttons | |
Buttons | Rebuild a buttons collection | |
Buttons | Get the container element for a single Buttons instance | |
Buttons | Get the container elements for one or more button instances | |
Buttons | Destroy one or more button instances and remove from the document | |
Buttons | Disable the selected buttons | |
Buttons | Enable / disable the selected buttons | |
Buttons | Get the button nodes for the selected buttons | |
Buttons | Set the processing state for multiple buttons | |
Buttons | Remove and delete the selected buttons | |
Buttons | Get / set the text for the selected buttons | |
Buttons | Trigger the action of the selected buttons | |
Buttons | Obtain data from the DataTable that is suitable for exporting | |
Buttons | Get export meta information that is common to many different button types | |
Buttons | Display and hide information for the end user in a modal box | |
ColReorder | Disable ColReorder's interactions | |
ColReorder | Enable or disable ColReorder's interactions | |
ColReorder | Programmatically move columns | |
ColReorder | Get / set column order | |
ColReorder | Restore the loaded column order | |
ColReorder | Convert one or more column indexes to and from current and original indexes | |
Editor | Edit a cell with inline or bubble editing | |
Editor | Edit cells with bubble editing | |
Editor | Get the Editor instance associated with this table. | |
Editor | Get information about an uploaded file | |
Editor | Get information about multiple uploaded files | |
Editor | Delete an existing row | |
Editor | Edit an existing row | |
Editor | Create a new row | |
Editor | Delete multiple existing rows | |
Editor | Edit multiple existing rows | |
FixedColumns | Namespace for FixedColumns methods | |
FixedColumns | Get / set the number of columns fixed at the end of a table | |
FixedColumns | Get / set the number of fixed columns on the left side of a table | |
FixedColumns | Get / set the number of fixed columns on the right side of a table | |
FixedColumns | Get / set the number of columns fixed at the start of a table | |
FixedHeader | Recalculate the position of the table and redraw the fixed elements | |
FixedHeader | Disable the fixed elements | |
FixedHeader | Enable / disable the fixed elements | |
FixedHeader | Get the current enabled status | |
FixedHeader | Get / set the fixed footer's offset | |
FixedHeader | Get / set the fixed header's offset | |
KeyTable | Focus on a cell | |
KeyTable | Blur focus from the table | |
KeyTable | Disable KeyTable's interactions (mouse and keyboard) | |
KeyTable | Enable or disable KeyTable's interactions (mouse and keyboard) | |
KeyTable | Determine the KeyTable enabled state for a table | |
KeyTable | Move the focus to an adjacent cell | |
Responsive | Get the responsive visibility state of a column in the table | |
Responsive | Get the responsive visibility state of columns in the table | |
Responsive | Determine if Responsive has hidden any columns in the table | |
Responsive | Obtain the cell index from a | |
Responsive | Recalculate the column breakpoints based on the class information of the column header cells | |
Responsive | Recalculate the widths used by responsive after a change in the display | |
RowGroup | Get / set the data source for the row grouping | |
RowGroup | Disable RowGroup's interaction with the table | |
RowGroup | Enable or disable RowGroup's interaction with the table | |
RowGroup | Determine if RowGroup is enabled on a table | |
RowReorder | Disable the user's ability to reorder rows. | |
RowReorder | Enable / disable the user's ability to reorder rows. | |
Scroller | Scroll to a specific row | |
Scroller | Recalculate the cached measurements that Scroller uses | |
Scroller | Get information about the rows that are currently being displayed | |
Scroller | Scroll to a specific row display index | |
SearchBuilder | Returns the node of the SearchBuilder container. | |
SearchBuilder | Get the details of the current search setup | |
SearchBuilder | Rebuild the search to a given state | |
SearchPanes | Clears the selections in all of the panes | |
SearchPanes | Returns the node of the panes container. | |
SearchPanes | Rebuild the pane, regathering options from the table. | |
SearchPanes | Resize all of the panes to fill the SearchPanes container appropriately. | |
Select | Deselect a single cell | |
Select | Select a single cell | |
Select | Determine if a cell has been selected | |
Select | Deselect cells | |
Select | Select cells | |
Select | Deselect a single column | |
Select | Select a single column | |
Select | Determine if a column has been selected | |
Select | Deselect columns | |
Select | Select columns | |
Select | Deselect a single row | |
Select | Select a single row | |
Select | Determine if a row has been selected | |
Select | Deselect rows | |
Select | Select rows | |
Select | Initialise Select from outside of the constructor | |
Select | Get / set the blurable state of the table's item selection options | |
Select | Get / set the information summary display state | |
Select | Get / set the items that Select will select based on user interaction (rows, columns or cells) | |
Select | Get / set the item selector for mouse event capture | |
Select | Get / set the style by which the end user can select items in the table | |
Select | Get / set the behaviour if items can be deselected when a selected item is clicked on | |
StateRestore | Get the details of all of the currently active states | |
StateRestore | Get a state from StateRestore | |
StateRestore | Load a state from StateRestore into the table | |
StateRestore | Remove a state from StateRestore | |
StateRestore | Rename a state from StateRestore | |
StateRestore | Save a state from StateRestore | |
StateRestore | Create a new state | |
StateRestore | Get states from StateRestore | |
StateRestore | Remove states from StateRestore |