File: error.xml

package info (click to toggle)
datatables.js 1.10.13%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,232 kB
  • ctags: 1,329
  • sloc: xml: 10,249; php: 4,387; sh: 492; makefile: 21
file content (49 lines) | stat: -rw-r--r-- 2,199 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?xml version="1.0" encoding="UTF-8" ?>
<dt-event>
	<name>error</name>
	<summary>Error event - An error has occurred during DataTables' processing of data.</summary>
	<since>1.10.5</since>

	<type type="function">
		<signature>function( e, settings, techNote, message )</signature>
		<parameter type="object" name="e">
			jQuery event object
		</parameter>
		<parameter type="DataTables.Settings" name="settings">
			DataTables settings object
		</parameter>
		<parameter type="integer" name="techNote">
			Tech note error number - use `http://datatables.net/tn/{techNote}` to look up a description
		</parameter>
		<parameter type="string" name="message">
			Description of error
		</parameter>
		<scope>HTML table element</scope>
	</type>

	<description>
		Error control is an important consideration in any complex application, and DataTables provides this event to allow you to hook your application's own error handling into DataTables. For example you could trigger an Ajax call that will log an error for investigation, or use the error event to show a custom error message to the end user.

		This event goes hand in hand with the `dt-init $.fn.dataTable.ext.errMode` option which controls how DataTables handles errors. That static option can take one of four values:

		* `-string alert` (default) - Alert the error
		* `-string throw` - Throw a Javascript error
		* `-string none` - Do nothing (you would want to use this `dt-event error` in this case)
		* `function` - A function common to all DataTables on the page that is called when an error occurs.

		Please note that, as with all DataTables emitted events, this event is triggered with the `dt` namespace. As such, to listen for this event, you must also use the `dt` namespace by simply appending `.dt` to your event name, as shown in the example below.
	</description>

	<example title="Use the event as a custom error handler"><![CDATA[
$.fn.dataTable.ext.errMode = 'none';

$('#example')
	.on( 'error.dt', function ( e, settings, techNote, message ) {
		console.log( 'An error has been reported by DataTables: ', message );
	} )
	.DataTable();

]]></example>

	<related>dt-init $.fn.dataTable.ext.errMode</related>
</dt-event>