|
ILIAS
trunk Revision v12.0_alpha-377-g3641b37b9db
|
Data Structures | |
| class | DataTableDemoRepo |
Functions | |
| base () | |
| repo_implementation () | |
| with_additional_viewcontrols () | |
| without_data () | |
| ILIAS\UI\examples\Table\Data\base | ( | ) |
expected output: >
This is what the table will look like: Columns define the nature (and thus: shape) of one field/aspect of the data record. Also, some functions of the table are set per column, e.g. sortability
Define actions: An Action is an URL carrying a parameter that references the targeted record(s). Standard Actions apply to both a collection of records as well as a single entry, while Single- and Multiactions will only work for one of them. Also see the docu-entries for Actions.
this is the endpoint for actions, in this case the same page.
Actions' commands and the row-ids affected are relayed to the server via GET. The URLBuilder orchestrates query-paramters (a.o. by assigning namespace)
We have to claim those parameters. In return, there is a token to modify the value of the param; the tokens will work only with the given copy of URLBuilder, so acquireParameters will return the builder as first entry, followed by the tokens.
array<string, Action> [action_id => Action]
the label as shown in dropdowns
set the actions-parameter's value; will become '&datatable_example_table_action=edit'
the Table will need to modify the values of this parameter; give the token.
An async Action will trigger an AJAX-call to the action's target and display the results in a modal-layer over the Table. Parameters are passed to the call, but you will have to completely build the contents of the response. DO NOT render an entire page ;)
Configure the Table to retrieve data with an instance of DataRetrieval; the table itself is agnostic of the source or the way of retrieving records. However, it provides View Controls and therefore parameters that will influence the way data is being retrieved. E.g., it is usually a good idea to delegate sorting to the database, or limit records to the amount of actually shown rows. Those parameters are being provided to DataRetrieval::getRows.
Actions may be disabled for specific rows:
setup the Table and hand over the request; with an ID for the table, parameters will be stored throughout url changes
build some output.
get the desired action from query; the parameter is namespaced, but we still have the token and it knows its name:
also get the row-ids and build some listing
take care of the async-call; 'delete'-action asks for it.
otherwise, we want the table and the results below
Definition at line 36 of file base.php.
References Vendor\Package\$a, Vendor\Package\$b, ILIAS\UI\examples\Layout\Page\Mail\$DIC, Vendor\Package\$f, $id, $out, ILIAS\UI\Implementation\Component\Table\$range, ILIAS\UI\examples\Layout\Page\Mail\$refinery, ILIAS\__construct(), ILIAS\Data\Order\DESC, exit, ILIAS\Data\Range\getLength(), ILIAS\Data\Range\getStart(), and ILIAS\Data\Order\join().
Here is the call graph for this function:| ILIAS\UI\examples\Table\Data\repo_implementation | ( | ) |
expected output: >
A Table is prone to reflect database tables, or, better repository entries. Usually, changes in the available data and their representation go along with each other, so it might be a good idea to keep that together.
Here is an example, in which the DataRetrieval extends the repository in which the UI-code becomes very small for the actual representation.
Please note that the pagination is missing due to an amount of records smaller than the lowest option "number of rows".
Definition at line 34 of file repo_implementation.php.
References $DIC.
| ILIAS\UI\examples\Table\Data\with_additional_viewcontrols | ( | ) |
description: > Example showing an Data Table with additional view controls.
expected output: > ILIAS shows the rendered Table Component with
The first Field Selection Control is from the optional columns.
All Viewcontrols may be operated independently and reflect the chosen value(s).
Please note the parameter $additional_viewcontrol_data
add view controls to the table
Definition at line 31 of file with_additional_viewcontrols.php.
References $DIC, Vendor\Package\$f, ILIAS\UI\Implementation\Component\Table\$range, ILIAS\UI\examples\Layout\Page\Mail\$refinery, and ILIAS\__construct().
Here is the call graph for this function:| ILIAS\UI\examples\Table\Data\without_data | ( | ) |
description: > Example showing a data table without any data and hence no entries, which will automatically display an according message.
expected output: >
Definition at line 39 of file without_data.php.
References $DIC, ILIAS\UI\Implementation\Component\Table\$range, $renderer, and ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\from().
Here is the call graph for this function: