{hero}

buttons.info()

Since: Buttons 1.0.0

Display and hide information for the end user in a modal box.
Please note - this property requires the Buttons extension for DataTables.

Description

When using Buttons you may find you wish to indicate to the end user that an action has been performed when a button has been clicked on. This might be a simple information message stating what has happened based on the button action, or can be more complex and potentially include complex data input / output. For example, in the copy to clipboard button this is used to inform the user that the copy has occurred - otherwise they wouldn't know as the action happens without user notification.

This method provides a very simple way to display a modal box presenting the end user with information.

Although specifically designed for use with Buttons, this method can be used externally to the Buttons actions should you wish to display a message to the end user.

Type

function buttons.info( title [, message [, time ]] )

Description:

Display / hide an information message to the end user to indicate that something has happened.

Parameters:
Returns:

DataTables API instance for chaining.

Examples

Display a notification message for 3 seconds:

var table = new DataTable('#myTable');

table.buttons.info('Notification', 'This is a notification message!', 3000);

Set a button's action to show a loading message, and then a done message when an Ajax process completes:

var table = new DataTable('#myTable');

table.button(0).action(function () {
	table.buttons.info('Please wait', 'Processing data...');

	$.ajax({
		// ...
		success: function () {
			table.buttons.info('Complete', 'Data processing complete', 2000);
		}
	});
});