List edit
The listedit element allows to edit the data in the displayed rows. Rows can be added and deleted.
The listedit element can be used with and without Ajax support. With Ajax support values saved and deleted on the server; without it, manage it by your own.
The data import and export by copy and paste is supported.
Attention a data validation is yet not implented in the front end. Saving invalid data in the back end is prevented.
User manual
Controls in the head line:
- Clear: empties the tabulator-list (url reload: all records are displayed again)
- Delete: selected? yes deletes selected rows, otherwise deletes all rows
- Save: selected? yes saves selected rows, otherwise saves all rows
Controls in the title line:
- ☐: select or deselet all
- sort: ▲ ascending, ▼ decending
- filter: write in your string, < and > are also allowed
- ⋮ :Attention choose decimal point manual
- : new row (record)
Controls in the rows (record):
- ☐: select or deselet the row
- : original record
- : changed record, save it
- : delete record
- : delete row, (record not saved yet)
Keyboard, table navigation
- ↑ ↓: row up or down
- ↹ ⇧Shift: next cell or cell back
Keyboard, edit
- ← →: move between the caracters
- ↑ ↓: number or date counts up or down
- space: by datetime opens the wizard
Copy & paste
- ctrl-c: Copy to the clipboard (seleted rows are copied
- ctrl-v: Paste from the clipboard (click a free space of the list (tabulator) first.
Developer
Place a listedit element on your page
The listedit element is made with the tabulator library.
The basic tabulator data structure is extended by the list edit element:
- k8.datadefAddlistedit(settings)
The element is displayed by the function:
- k8.displaytabulator(selector,settings)
It returns a tabulator object:
- mytableTab
Configurations
tabulatoreditajax
- 0: no ajax, save by yourself
- 1: (default) adds a save button to the right of each row. If a cell is edited, it needs to be saved by button click.
- 2: save the edited column directly
tabulatortabsave
Only with tabulatoreditajax 1: the save button of the row in the Tab order.
- 1: (default) after the last field Tab moves to the save button, Enter or Space press it. The changed row is saved by the keyboard.
- 0: Tab moves to the next row, the row is saved by a click on the button.
tabulatorenter
Enter in the editor of a datalist column (the page is not loaded again):
- 1: (default) to the next cell, like Tab
- 2: saves the row
- 0: nothing
tabulatormode
- 0: none
- 1: adds a save button in the foot
- 2: adds a save button in the foot and removew the row after save
tabulatorbinsert
tabulatorbinsert defines the position of a new row:
- true: adds new row at the top
- false: adds new row at the bottom
tabulatordeletepos
tabulatordeletepos defines the position of the column with the new / delete buttons:
- right: the column is the last one (default in listedit,
tabulatoreditajax> 0) - left: the column is the first one (default in the other modes)
tabulatorwrapper
True, adds a tabulatorwrapper with headline.
tabulatoredit
it's adds an icon to open a form for the record
- 0: none
- 1: icon to the left
- 2: icon to the right
bresize
True, adds a resizer.
Editors
Automatic by listedit
Different data types need different Editors. The editors can be defined in the tabulator data structure. Without an explicit definition the listedit element automatically supports:
- input
- number
- date
- time
- datetime
- select (see below)
Select editor
A column with the formatter #function#k8tabulatorformatter# (e.g. a column of a group) gets the editor k8SelectEditor. The values to choose from are the headerFilterParams.values of the column (for a group column they are set automatically).
- key "space" or a click opens the option list
- Up / Down: choose a value, Enter: take it over and go to the next cell, Esc: cancel
- Tab goes on to the next field, also after a choice with the mouse
Validation
example for a column with own rules:
Required columns: automatic
A column which is marked as required in the data definition must be filled. You do not have to configure anything in the list.
Own rules: validator
Add the property validator to a column of the list. In the example, "Hours" must be filled and between 0 and 24. Other rules are listed at Tabulator validate.
Save
Before the row saved, the validators are checked. The invalid cells are marked red, and a message names the columns.
Differences masterdata and listedit
| functionality | masterdata | listedit |
|---|---|---|
| options menu | ||
| defaultvalues | ||
| k8form elements | ||
| colored group (141 + 145) | ||
| clipboard |
The element listedit is independent module and not same to masterdata. The table shows the supported functionality of both.
tabulator, basics for edit
This is the json definition for the row selection:
height
A specific height can be configured.
clipboard
Enables copy and paste from the table (cursor need to be placed in the table):
- strg-c copies to the clipboard
- strg-v pastes into the table
Please, pay attention to the ⋮ in the headline for the decimal numbers:
- decimal point
- auto
- decimal komma
tabEndNewRow
Automatically adds a new row by leaving the last input field.
tabulator, column join
This is the json definition of a joined tabulator column:
The joined tabulator column categoryID consist of the following properties:
- headerFilter: list
- headerFilterParams
- values[]
- value: "your value", text: "your text"
- values[]
- headerFilterParams
- formatter: lookup
- formatterParams{}:
- "<value>":"<text>"
- formatterParams{}:
- editor: list
- editorParams
- values[]: same headerFilterParams
- editorParams
For more details look to:
tabulator, add row selection
This is the json definition for the row selection:
selectableRows allows to select rows; for example by click on the row.
The rowHeader adds a checkbox to:
- row header
- left side of the row
For more details look to:
tabulator, add movable row handler
This is the json definition for a movable rowHandler:
movableRows allows to move rows.
The row handler adds a drag handler to the rows.
For more details look to:
The row handler can also declared in the columns:
The row handler adds a drag handler to the rows. Here, the icon is changed to an arrow.
For more details look to: