Register | Sign in
DataTables Editor - inline form commands

A lot of the Editor examples use TableTools to provide buttons and row selection interaction options. While it is sometimes convenient to use TableTools in this manner, it is not always the interface method that you will wish to present to your end users. Editor does not require TableTools in order to function, as shown in this example where edit and delete links are shown inline with the table data and the 'new' option is a link at the top of the table.

This example shows the use of the create, edit and remove API methods, which are activated when required by standard jQuery events. With this API Editor is very powerful as it can be accessed and controlled in any way you wish.

Two other points worth noting about the example is the use of sDefaultContent for the admin column (in combination with a null value for mData) to display the edit/delete links. Additionally the 'remove' action does not ask for user confirmation, it simply enacts the delete request immediately through the way the remove method is called.

Create new record
Browser Rendering engine Platform(s) CSS grade Admin
Browser Rendering engine Platform(s) CSS grade Admin

Initialisation code

The Javascript below is what is used on this page for the example shown.


				

Table HTML

The HTML shown below shows the TABLE that is used in this example.


				

Server-side PHP

The code below is that HTML that is used to drive the server-side section of this exampe.


				

Included media files:

The HTML shown below includes the Javascript and CSS files that are required for the Editor operation on this page. You can use this as a template for your own pages, but if you move the files you might need to update the paths.


				

Communication of Editor between the client and server:

Editor submits and retrieves information by Ajax requests. The two blocks below show the data that Editor submits and receives, to and from the server. This is updated live as you interact with Editor so you can see what is submitted.

Submitted data:

The following shows the data that has been submitted to the server when a request is made to add, edit or delete data from the table.

// No data yet submitted

Server response:

The following shows the data that has been returned by the server in response to the data submitted on the left and is then acted upon.

// No data yet received

Data for DataTables from server:

DataTables can request information to display from the server when the page first loads. The block below shows the response from the server.


				

Examples

Basic:
Advanced: