11 $f = $DIC[
'ui.factory'];
12 $r = $DIC[
'ui.renderer'];
16 [
'f1' =>
'value1.1',
'f2' =>
'value1.2',
'f3' => 1.11],
17 [
'f1' =>
'value2.1',
'f2' =>
'value2.2',
'f3' => 2.22],
18 [
'f1' =>
'value3.1',
'f2' =>
'value3.2',
'f3' => 4.44],
19 [
'f1' =>
'value4.1',
'f2' =>
'value4.2',
'f3' => 8.88]
24 'f1' =>
$f->table()->column()->text(
"Field 1")
25 ->withIsSortable(
false),
27 'f0' =>
$f->table()->column()->text(
"empty"),
29 'f2' =>
$f->table()->column()->text(
"Field 2")
30 ->withIsOptional(
true)
31 ->withIsInitiallyVisible(
false),
33 'f3' =>
$f->table()->column()->number(
"Field 3")
34 ->withIsOptional(
true)
37 'f4' =>
$f->table()->column()->number(
"Field 4")
38 ->withIsOptional(
false)
42 $data_retrieval =
new class($dummy_records) extends
T\DataRetrieval {
47 $this->records = $dummy_records;
50 public function getRows(
51 I\RowFactory $row_factory,
54 array $visible_column_ids,
55 array $additional_parameters
57 foreach ($this->records as $record) {
59 $record[
'f4'] = $record[
'f3'] * 2;
61 yield $row_factory->map($record);
67 $table =
$f->table()->data(
'a data table', 50)
69 ->withData($data_retrieval);
72 $request = $DIC->http()->request();
73 return $r->render($table->withRequest($request));
Both the subject and the direction need to be specified when expressing an order. ...
__construct(Container $dic, ilPlugin $plugin)
A simple class to express a naive range of whole positive numbers.