DataTable.key()

Since: DataTables 3

Set a license key.

Description

Starting with DataTables 3, there is a DataTables Plus purchase option which had extensions such as Editor available as part of it. When you purchase DataTables Plus you will receive a license key. To use the extensions that are part of DataTables Plus you must register this key with your DataTables install.

Please note that DataTables core does not require "DataTables Plus" for any build in features. The "Plus" plan is for the commercial extensions, but this method provides a central location for registering your license key.

Type

key(value)

Set the license key for DataTables Plus usage.

Parameters:

Returns:

void: No value is returned.

Examples

Use a license key (ESM):

import DataTable from 'datatables.net';
import 'datatables.net-editor';

DataTable.key('__YOUR_LICENSE_KEY__');

// Initialise Editor (a "Plus" extension)
new DataTable.Editor({
	// ...
});

// Initialise DataTables
new DataTable('#example');

Use a license key (CDN) loaded files):

DataTable.key('__YOUR_LICENSE_KEY__');

// Initialise Editor (a "Plus" extension)
new DataTable.Editor({
	// ...
});

// Initialise DataTables
new DataTable('#example');