Skip to content

Commit 8fbc2ad

Browse files
authored
Merge pull request yajra#125 from mgralikowski/4.0
HTML title for columns labels.
2 parents a66ed58 + 3a32893 commit 8fbc2ad

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/Html/Column.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,19 @@ public function footer($value)
504504
return $this;
505505
}
506506

507+
/**
508+
* Set custom html title instead defult label.
509+
*
510+
* @param mixed $value
511+
* @return $this
512+
*/
513+
public function titleAttr($value)
514+
{
515+
$this->attributes['titleAttr'] = $value;
516+
517+
return $this;
518+
}
519+
507520
/**
508521
* @return array
509522
*/

src/Html/HasTable.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ protected function compileTableHeaders()
124124
foreach ($this->collection->toArray() as $row) {
125125
$thAttr = $this->html->attributes(array_merge(
126126
Arr::only($row, ['class', 'id', 'title', 'width', 'style', 'data-class', 'data-hide']),
127-
$row['attributes']
127+
$row['attributes'],
128+
isset($row['titleAttr']) ? ['title' => $row['titleAttr']] : [],
128129
));
129130
$th[] = '<th ' . $thAttr . '>' . $row['title'] . '</th>';
130131
}

0 commit comments

Comments
 (0)