Skip to content

Commit f1340a2

Browse files
author
Fabian Mangelsdorf
committed
can set tooltip to column
1 parent 730f198 commit f1340a2

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/Column.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class Column
1111
public $type = 'string';
1212
public $index = 0;
1313
public $label;
14+
public $tooltip;
1415
public $name;
1516
public $select;
1617
public $joins;
@@ -144,9 +145,9 @@ public function enableSummary()
144145

145146
public function disableSummary()
146147
{
147-
$this->summary = false;
148+
$this->summary = false;
148149

149-
return $this;
150+
return $this;
150151
}
151152

152153
public function setIndex($index)
@@ -155,6 +156,16 @@ public function setIndex($index)
155156

156157
return $this;
157158
}
159+
160+
public function tooltip($text, $label = null)
161+
{
162+
$this->tooltip = [
163+
'text' => $text,
164+
'label' => $label
165+
];
166+
167+
return $this;
168+
}
158169

159170
public function sortBy($column)
160171
{

src/Http/Livewire/LivewireDatatable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ public function getViewColumns()
267267
'index',
268268
'hidden',
269269
'label',
270+
'tooltip',
270271
'group',
271272
'summary',
272273
'content',
@@ -1087,7 +1088,6 @@ public function getPaginationControlsProperty()
10871088
public function getResultsProperty()
10881089
{
10891090
$this->row = 1;
1090-
10911091
return $this->mapCallbacks(
10921092
$this->getQuery()->paginate($this->perPage)
10931093
);

0 commit comments

Comments
 (0)