# Editor example Inline editing

This example is basically the same as the simple standalone editing example but in this case the `inline()E` method is used for editing the fields, rather than the `edit()E` primary method for editing the whole form.

Standalone forms can befit from inline editing in exactly the same way as DataTables based editing forms and with all of the same features. As with DataTables, this can be very beneficial for speed of editing.

State:
  Enabled
Server IP:
  153.63.213.41
Poll period:
  60 seconds
Protocol:
  TCP

- Javascript
- HTML
- CSS
- Ajax
- Server-side script

The Javascript shown below is used to initialise the table shown in this example:

`var editor; // use a global for the submit and return data rendering in the examples $(document).ready(function() { editor = new $.fn.dataTable.Editor( { ajax: "../php/standalone.php", fields: [ { label: "Status:", name: "enable", type: 'radio', ipOpts: [ { label: 'Enabled', value: 'Enabled' }, { label: 'Disabled', value: 'Disabled' } ] }, { label: "Server IP address:", name: "server-ip" }, { label: "Polling period:", fieldInfo: "Input value is in seconds", name: "poll-period" }, { name: "protocol", // `label` since `data-editor-label` is defined for this field type: "select", ipOpts: [ { label: 'TCP', value: 'TCP' }, { label: 'UDP', value: 'UDP' } ] } ] } ); $('[data-editor-field]').on( 'click', function (e) { editor.inline( this, { buttons: '_basic' } ); } ); } );`

In addition to the above code, the following Javascript library files are loaded for use in this example:

- ../../../../media/js/jquery.js
- ../../../../media/js/jquery.dataTables.js
- ../../js/dataTables.editor.js

The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:

This example uses a little bit of additional CSS beyond what is loaded from the library files (below), in order to correctly display the table. The additional CSS used is shown below:

`dt { margin-top: 1em; } dt:first-child { margin-top: 0; } dd { width: 25% } *[data-editor-field] { border: 1px dashed #ccc; padding: 0.5em; margin: 0.5em; } *[data-editor-field]:hover { background: #f3f3f3; border: 1px dashed #333; }`

The following CSS library files are loaded for use in this example to provide the styling of the table:

- ../../../../media/css/jquery.dataTables.css
- ../../css/dataTables.editor.css

This table loads data by Ajax. The latest data that has been loaded is shown below. This data will update automatically as any additional data is loaded.

The script used to perform the server-side processing for this table is shown below. Please note that this is just an example script using PHP. Server-side processing scripts can be written in any language, using the protocol described in the DataTables documentation.