Skip to content

Commit c59fac2

Browse files
committed
Updates
1 parent b28cb4c commit c59fac2

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

wfc/ui/vuetify/DataTable.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function getPageSizeInput() : HTMLNode {
105105
* <li>page_number: Represent current active page.</li>
106106
* <li>pages_count: Number of pages. This usually is fetched from backend.</li>
107107
* <li>size: Size of one page. Simply, number of records in one page.</li>
108-
* <li>An array that contain number of items per page like 5, 10, 20</li>
108+
* <li>pages_options: An array that contain number of items per page like 5, 10, 20</li>
109109
* </ul>
110110
* @param string $name Name of the model. Defined in 'data' section.
111111
*/
@@ -118,6 +118,10 @@ public function setPagingModel(string $name) {
118118
'v-model' => $name.'.size',
119119
':items' => $name.'.size_options',
120120
]);
121+
$this->setAttributes([
122+
':page.sync' => $name.'.page_number',
123+
':items-per-page' => $name.'.page.size',
124+
]);
121125
}
122126
/**
123127
* Sets if the table will have a footer or not.

wfc/ui/vuetify/Tooltip.php

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ public function __construct(HTMLNode $activator = null, HTMLNode $tooltip = null
3434
$this->setTooltip($tooltip);
3535
}
3636
}
37+
/**
38+
* Sets the element that will act as tooltip activator.
39+
*
40+
* @param HTMLNode $el
41+
*/
3742
public function setActivator(HTMLNode $el) {
3843
$this->contentArea->removeAllChildNodes();
3944
$el->setAttributes([
@@ -43,21 +48,23 @@ public function setActivator(HTMLNode $el) {
4348
$this->contentArea->addChild($el);
4449
}
4550
/**
46-
* A method that does nothing.
51+
* Sets the element that will act as the tooltip.
4752
*
48-
* @param type $node
49-
* @param type $attrsOrChain
50-
* @param type $chainOnParent
53+
* @param HTMLNode $el
5154
*/
52-
public function addChild($node, $attrsOrChain = [], $chainOnParent = false) {
53-
54-
}
5555
public function setTooltip(HTMLNode $el) {
5656
if ($this->childrenCount() == 2) {
5757
$this->removeLastChild();
5858
}
5959
parent::addChild($el);
6060
}
61+
/**
62+
* Sets the position of the tooltip.
63+
*
64+
* The position will be relative to the activator.
65+
*
66+
* @param string $position
67+
*/
6168
public function setPosition(string $position) {
6269
$this->setAttribute($position);
6370
}

0 commit comments

Comments
 (0)