Namespace: events

Ancestry: Editor » .defaults. » events

DataTables Editor v1.2.4 documentation

Navigation

Hiding private elements (toggle)
Showing extended elements (toggle)

Events / callbacks - event handlers can be assigned as an individual function during initialisation using the parameters in this name space. The names, and the parameters passed to each callback match their event equivalent in the Editor object.

Summary

Properties - static

<static> onClose :function

Form hidden event, fired when the form is removed from the document. The of the inverse onOpen event.

<static> onCreate :function

Create new row event, fired when a new row has been created in the DataTable by a form submission. This is called just after the fnAddData call to the DataTable.

<static> onEdit :function

Edit row event, fired when a row has been edited in the DataTable by a form submission. This is called just after the fnUpdate call to the DataTable.

<static> onInitComplete :function

Initialisation of the Editor instance has been completed.

<static> onInitCreate :function

Create method activated event, fired when the create API method has been called, just prior to the form being shown. Useful for manipulating the form specifically for the create state.

<static> onInitEdit :function

Edit method activated event, fired when the edit API method has been called, just prior to the form being shown. Useful for manipulating the form specifically for the edit state.

<static> onInitRemove :function

Remove method activated event, fired when the remove API method has been called, just prior to the form being shown. Useful for manipulating the form specifically for the remove state.

<static> onOpen :function

Form displayed event, fired when the form is made available in the DOM. This can be useful for fields that require height and width calculations to be performed since the element is not available in the document until the form is displayed.

<static> onPostCreate :function

As per the onCreate event - included for naming consistency.

<static> onPostEdit :function

As per the onEdit event - included for naming consistency.

<static> onPostRemove :function

As per the onRemove event - included for naming consistency.

<static> onPostSubmit :function

Post-submit event for the form, fired immediately after the data has been loaded by the Ajax call, allowing modification or any other interception of the data returned form the server.

<static> onPreClose :function

Before a form is closed, this event is fired. It allows the close action to be cancelled by returning false from the function. This can be useful for confirming that the user actually wants to close the display (if they have unsaved changes for example).

<static> onPreCreate :function

Pre-create new row event, fired just before DataTables calls the fnAddData method to add new data to the DataTable, allowing modification of the data that will be used to insert into the table.

<static> onPreEdit :function

Pre-edit row event, fired just before DataTables calls the fnUpdate method to edit data in a DataTables row, allowing modification of the data that will be used to update the table.

<static> onPreOpen :function

Before a form is displayed, this event is fired. It allows the open action to be cancelled by returning false from the function.

<static> onPreRemove :function

Pre-remove row event, fired just before DataTables calls the fnDeleteRow method to delete a DataTables row.

<static> onPreSubmit :function

Pre-submit event for the form, fired just before the data is submitted to the server. This event allows you to modify the data that will be submitted to the server. Note that this event runs after the 'formatdata' callback function of the Editor#submit API method.

<static> onProcessing :function

Processing event, fired when Editor submits data to the server for processing. This can be used to provide your own processing indicator if your UI framework already has one.

<static> onRemove :function

Row removed event, fired when a row has been removed in the DataTable by a form submission. This is called just after the fnDeleteRow call to the DataTable.

<static> onSetData :function

Set data event, fired when the data is gathered from the form to be used to update the DataTable. This is a "global" version of onPreCreate, onPreEdit and onPreRemove and can be used to manipulate the data that will be added to the DataTable for all three actions

<static> onSubmitComplete :function

Submission complete event, fired when data has been submitted to the server and after any of the return handling code has been run (updating the DataTable for example). Note that unlike onSubmitSuccess and onSubmitError, onSubmitComplete will be fired for both a successful submission and an error. Additionally this event will be fired after onSubmitSuccess or onSubmitError.

<static> onSubmitError :function

Submission complete, but in error event, fired when data has been submitted to the server but an error occurred on the server (typically a JSON formatting error)

<static> onSubmitSuccess :function

Submission complete and successful event, fired when data has been successfully submitted to the server and all actions required by the returned data (inserting or updating a row) have been completed.

Details

Properties - static

<static> onClose :function

Form hidden event, fired when the form is removed from the document. The of the inverse onOpen event.

<static> onCreate :function

Create new row event, fired when a new row has been created in the DataTable by a form submission. This is called just after the fnAddData call to the DataTable.

Parameters:
Name Type Attributes Default Description
1
jsonobject

The JSON object returned from the server

2
dataobject

The data that was used to update the DataTable

<static> onEdit :function

Edit row event, fired when a row has been edited in the DataTable by a form submission. This is called just after the fnUpdate call to the DataTable.

Parameters:
Name Type Attributes Default Description
1
jsonobject

The JSON object returned from the server

2
dataobject

The data that was used to update the DataTable

<static> onInitComplete :function

Initialisation of the Editor instance has been completed.

<static> onInitCreate :function

Create method activated event, fired when the create API method has been called, just prior to the form being shown. Useful for manipulating the form specifically for the create state.

<static> onInitEdit :function

Edit method activated event, fired when the edit API method has been called, just prior to the form being shown. Useful for manipulating the form specifically for the edit state.

<static> onInitRemove :function

Remove method activated event, fired when the remove API method has been called, just prior to the form being shown. Useful for manipulating the form specifically for the remove state.

<static> onOpen :function

Form displayed event, fired when the form is made available in the DOM. This can be useful for fields that require height and width calculations to be performed since the element is not available in the document until the form is displayed.

<static> onPostCreate :function

As per the onCreate event - included for naming consistency.

Parameters:
Name Type Attributes Default Description
1
jsonobject

The JSON object returned from the server

2
dataobject

The data that was used to update the DataTable

<static> onPostEdit :function

As per the onEdit event - included for naming consistency.

Parameters:
Name Type Attributes Default Description
1
jsonobject

The JSON object returned from the server

2
dataobject

The data that was used to update the DataTable

<static> onPostRemove :function

As per the onRemove event - included for naming consistency.

Parameters:
Name Type Attributes Default Description
1
jsonobject

The JSON object returned from the server

<static> onPostSubmit :function

Post-submit event for the form, fired immediately after the data has been loaded by the Ajax call, allowing modification or any other interception of the data returned form the server.

Parameters:
Name Type Attributes Default Description
1
jsonobject

The JSON object returned from the server

2
dataobject

The data object that was be submitted to the server

<static> onPreClose :function

Before a form is closed, this event is fired. It allows the close action to be cancelled by returning false from the function. This can be useful for confirming that the user actually wants to close the display (if they have unsaved changes for example).

<static> onPreCreate :function

Pre-create new row event, fired just before DataTables calls the fnAddData method to add new data to the DataTable, allowing modification of the data that will be used to insert into the table.

Parameters:
Name Type Attributes Default Description
1
jsonobject

The JSON object returned from the server

2
dataobject

The data that will be used to update the DataTable

<static> onPreEdit :function

Pre-edit row event, fired just before DataTables calls the fnUpdate method to edit data in a DataTables row, allowing modification of the data that will be used to update the table.

Parameters:
Name Type Attributes Default Description
1
jsonobject

The JSON object returned from the server

2
dataobject

The data that will be used to update the DataTable

<static> onPreOpen :function

Before a form is displayed, this event is fired. It allows the open action to be cancelled by returning false from the function.

<static> onPreRemove :function

Pre-remove row event, fired just before DataTables calls the fnDeleteRow method to delete a DataTables row.

Parameters:
Name Type Attributes Default Description
1
jsonobject

The JSON object returned from the server

<static> onPreSubmit :function

Pre-submit event for the form, fired just before the data is submitted to the server. This event allows you to modify the data that will be submitted to the server. Note that this event runs after the 'formatdata' callback function of the Editor#submit API method.

Parameters:
Name Type Attributes Default Description
1
dataobject

The data object that will be submitted to the server

<static> onProcessing :function

Processing event, fired when Editor submits data to the server for processing. This can be used to provide your own processing indicator if your UI framework already has one.

Parameters:
Name Type Attributes Default Description
1
processingboolean

Flag for if the processing is running (true) or not (false).

<static> onRemove :function

Row removed event, fired when a row has been removed in the DataTable by a form submission. This is called just after the fnDeleteRow call to the DataTable.

Parameters:
Name Type Attributes Default Description
1
jsonobject

The JSON object returned from the server

<static> onSetData :function

Set data event, fired when the data is gathered from the form to be used to update the DataTable. This is a "global" version of onPreCreate, onPreEdit and onPreRemove and can be used to manipulate the data that will be added to the DataTable for all three actions

Parameters:
Name Type Attributes Default Description
1
jsonobject

The JSON object returned from the server

2
dataobject

The data that will be used to update the DataTable

3
actionstring

The action being performed by the form - 'create', 'edit' or 'remove'.

<static> onSubmitComplete :function

Submission complete event, fired when data has been submitted to the server and after any of the return handling code has been run (updating the DataTable for example). Note that unlike onSubmitSuccess and onSubmitError, onSubmitComplete will be fired for both a successful submission and an error. Additionally this event will be fired after onSubmitSuccess or onSubmitError.

Parameters:
Name Type Attributes Default Description
1
jsonobject

The JSON object returned from the server

2
dataobject

The data that was used to update the DataTable

<static> onSubmitError :function

Submission complete, but in error event, fired when data has been submitted to the server but an error occurred on the server (typically a JSON formatting error)

Parameters:
Name Type Attributes Default Description
1
xhrobject

The Ajax object

2
errstring

The error message from jQuery

3
thrownobject

The exception thrown by jQuery

4
dataobject

The data that was used to update the DataTable

<static> onSubmitSuccess :function

Submission complete and successful event, fired when data has been successfully submitted to the server and all actions required by the returned data (inserting or updating a row) have been completed.

Parameters:
Name Type Attributes Default Description
1
jsonobject

The JSON object returned from the server

2
dataobject

The data that was used to update the DataTable