# DataTables: AltEditor (beta) ADDON Custom made editor plugin designed for Datatables

About

DataTables AltEditor is a MIT licensed free editor. The plugin adds capabilities to add, edit and delete rows in your datatables through the use of modals. We have modified the editor extensively to be used with SmartAdmin WebApp and make your job a little easier. This current version of AltEditor is exclusive to SmartAdmin and we intend to keep it up to date to be compatible with DataTables.

You can find the definitions of its elements on their official github page. Note: Only use the exclusive plugin included with this WebApp as the one on github may not be compatible with SmartAdmin.

## Example Table

Datatable accepts the following callback functions as arguments: `onAddRow(datatable, rowdata, success, error)`, `onEditRow(datatable, rowdata, success, error)`, `onDeleteRow(datatable, rowdata, success, error)`

In the most common case, these function should call `$.ajax` as expected by the webservice. The two functions success and error should be passed as arguments to `$.ajax`. Webservice must return the modified row in JSON format, because the success() function expects this. Otherwise you have to write your own success() callback (e.g. refreshing the whole table).

##### Event logs (AJAX Calls)

IE Support
The latest update for Alt-Editor has dropped support for IE in general. We have included the latest version of Alt-editor (catered for SmartAdmin) inside `src/custom/plugins/datatables-alteditor/datatables-alteditor-latest.js` found only in the HTML flavor. You may switch to this latest version of Alt editor to gain access to the Support Modifiers below.

Column option | Accepted values | Description
--- | --- | ---
`type` | `"text" | "select" | "hidden" | ...` | Type of HTML input to be shown. The value `readonly` is accepted for backward compatibility, but deprecated.
`readonly` | `true | false` | Add `readonly` HTML attribute
`disabled` | `true | false` | Add `disabled` HTML attribute
`required` | `true | false` | Add `required` HTML attribute
`hoverMsg` | `"some msg"` | The message will appear as a tooltip over the input field.
`unique` | `true | false` | Ensure that no two rows have the same value. The check is performed client side, not server side. Set HTML `"data-unique"` attribute. (Probably there's some issue with this).
`uniqueMsg` | `"some msg"` | An error message that is displayed when the unique constraint is not respected. Set HTML `"data-uniqueMsg"` attribute.
`special` | `"any string"` | Set HTML `"data-special"` attribute (don't know what's that needed for).
`editorOnChange` | function | Custom onchange function. It will take as arguments the jquery event and the altEditor object.
Options for columns with type `"text"`:
`pattern` | `r.e.` | The typed text will be matched against given regular expression, before submit.
`msg` | `"some msg"` | An error message that is displayed in case pattern is not matched. Set HTML `"data-errorMsg"` attribute.
`maxLength` | `integer` | Set HTML `"maxlength"` attribute.
`datepicker` | `{}` | Enable a datepicker component. jQuery-UI plugin must be linked. More datepicker configuration options may be passed within the object.
`datetimepicker` | `{}` | Enable a datetimepicker component. jQuery datetimepicker plugin must be linked. More datetimepicker configuration options may be passed within the object.
Options for columns with type `"select"`:
`options` | `["a", "b", "c"]` or `{"a":"A", "b":"B", "c":"C"}` | The options that shall be presented.
`select2` | `{}` | Enable a select2 component. Select2 jQuery plugin must be linked. More select2 configuration options may be passed within the object.
`multiple` | `true | false` | Set HTML `"multiple"` attribute.
Options for columns with type `"textarea"`:
`rows` | `integer` | Set HTML `"rows"` attribute.
`cols` | `integer` | Set HTML `"cols"` attribute.

- Home
- Inbox
- Add More

Tracey Chang
IT Director

- Tracey Chang Online
- Oliver Kopyuv Online
- Dr. John Cook PhD Away
- Ali Amdaney Online
- Sarah McBrook Online
- oliver.kopyuv@gotbootstrap.com Offline
- oliver.kopyuv@gotbootstrap.com Busy
- oliver.kopyuv@gotbootstrap.com Offline
- +714651347790 Missed Call

Jun 19

Hey Tracey, did you get my files?

3:00 pm

Hi

Sorry going through a busy time in office. Yes I analyzed the solution.

It will require some resource, which I could not manage.

3:24 pm

Okay

Sending you some dough today, you can allocate the resources to this project.

3:26 pm

Perfect. Thanks a lot!

I will have them ready by tonight.

Cheers

Jun 20
Send

#### Layout Settings User Interface Settings

##### App Layout

Fixed Header header is in a fixed at all times
Fixed Navigation left panel is fixed
Minify Navigation Skew nav to maximize space
Hide Navigation roll mouse on edge to reveal
Top Navigation Relocate left pane to top
Fixed Footer page footer is fixed
Boxed Layout Encapsulates to a container

Fixed Background

##### Mobile Menu

Push Content Content pushed on menu reveal
No Overlay Removes mesh on menu reveal
Off-Canvas (beta) Content overlaps menu

##### Accessibility

Bigger Content Font content fonts are bigger for readability
High Contrast Text (WCAG 2 AA) 4.5:1 text contrast ratio
Daltonism (beta) color vision deficiency
Preloader Inside preloader will be inside content
SmartPanel Icons (not Panels) smartpanel buttons will appear as icons

##### Global Modifications

Clean Page Background adds more whitespace
Hide Navigation Icons invisible navigation icons
Disable CSS Animation Disables CSS based animations
Hide Info Card Hides info card from left panel
Lean Subheader distinguished page header
Hierarchical Navigation Clear breakdown of nav links
Dark Navigation Navigation background is darkend

##### Global Font Size

SM MD LG XL
Change root font size to effect rem values (resets on page refresh)

##### Theme colors more info

##### Theme Modes (beta) why beta?

###### Internet Explorer Issue

This particular component may not work as expected in Internet Explorer. Please use with caution.
Default
Light
Dark

Reset Settings
Factory Reset