Search by

datatables.net / datatables.net-staterestore-dt

DataTables

StateRestore for DataTables with styling for [DataTables](https://datatables.net/)

Package info

github.com/DataTables/Dist-DataTables-StateRestore-DataTables

Homepage

Forum

Language:CSS

pkg:composer/datatables.net/datatables.net-staterestore-dt

Statistics

Installs: 455

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

2.0.0 2026-09-11 12:07 UTC

This package is auto-updated.

Last update: 2026-09-11 12:08:12 UTC


README

StateRestore is a state management UI for DataTables. It allows users to create multiple table states which can be saved and then reloaded at any time. This is particularly useful for complex tables where specific views are common and the user might wish to toggle between states.

States can be saved locally, or for a more permanent part of your table's features, to a remote database via Ajax, which also provides the ability for users to share states.

For full information about StateRestore including its features and configuration option, please refer to the DataTables manual.

Installation

The easiest way to install any extension for for DataTables, including StateRestore, is with the download builder. With the download builder, you select the styling and aspects of DataTables suite that you want, and it will generate the packages / install commands for you to use.

The download builder includes options for direct loading with script and link tags, details for using a package manager such as npm and NuGet, or a download option if you wish to have the files locally.

NPM

Installation from NPM can be done with the datatables.net-staterestore-dt package:

npm install \
    datatables.net-dt \
    datatables.net-buttons-dt \
    datatables.net-staterestore-dt

Basic Usage

In its most simple case, you can enable StateRestore by simply setting stateRestore: true as an option in the DataTables initialisation.

import DataTable from 'datatables.net-dt';
import 'datatables.net-buttons-dt'
import 'datatables.net-staterestore-dt'

// Register DataTables Plus license key
DataTable.key('plus_....');

// Initialisation
new DataTable('#myTable', {
	layout: {
		topStart: {
			buttons: ['stateCreate', 'statesList', 'pageLength']
		}
	},
	stateRestore: true
});

Documentation / Support

License

This software is released under the DataTables Plus License. To use the software a license key must be applied - see DataTables Plus.