Purpose
Set index page table properties, like table entries, color, ...
...
return either a array with following fields or (for historical reasons) return a string with index/header description:
Key | Type | Example | |
---|---|---|---|
table | string | Tablename of model | $this->table, 'modems' |
index_header | array | fields to display on index screen, each array entry is splitted in table <td> segments |
[$this->table.'.id', $this->table.'.mac', 'configfile.name', $this->table.'.model', $this->table.'.sw_rev', $this->table.'.name', $this->table.'.firstname', $this->table.'.lastname', $this->table.'.city', $this->table.'.district', $this->table.'.street', $this->table.'.house_number', $this->table.'.us_pwr', $this->table.'.geocode_source', $this->table.'.inventar_num', 'contract_valid'] | |||
bsclass | string | bootstrap class of table segments | 'success', 'warning', 'danger', 'info' |
header | string | string to display in
|
- TODO: add AJAX stuff (Christian Schramm)
...
edit | array | customfunction will be called for every element in table.column, foreigntable.column or customcolumn CAREFUL customcolumn will not be sortable or searchable - to use them anyways use the disable_sortsearch key | [$table.'.column1' => 'customfunction', 'foreigntable.column' => 'customfunction', 'customcolumn' => 'customfunction'] |
...
...
eager_loading |
...
array | eager load foreign tables | [foreigntable1, foreigntable2, ...] |
...
...
order_by | array |
...
['0' => 'asc'] - order table by id in ascending order, ['1' => 'desc'] - order table after first column in descending order |
...
[' |
...
0' => ' |
...
asc'] | ||
disable_sortsearch | array | disables sorting & searching for the chosen column (e.g. when it is impossible) => prevent errors |
...
['customcolumn' => 'false'] |
Info | ||
---|---|---|
| ||
See for new AJAX implementation: https://github.com/schmto/nmsprime/pull/26/commits/b621e9ba137d040d4f96a9a0b9b050451fb89f83 |
...
Tree View
Requirements
parent_id in table
index_tree_view = true in Controller of the MVC
defined parent() and childen() function in model
view_index_label function
Optional
set icon type via $model->get_icon_type()
make entries undeletable via Model::undeletables()
...