Skip to content

Commit

Permalink
isSortable ergänzt.
Browse files Browse the repository at this point in the history
  • Loading branch information
dergel committed Nov 11, 2024
1 parent ada7342 commit 819a7a1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fragments/yform/manager/page/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@
if ('value' == $field->getType()) {
if ($field->isHiddenInList()) {
$list->removeColumn($field->getName());
} else {
} elseif ($field->isSortable()) {
$list->setColumnSortable($field->getName());
$list->setColumnLabel($field->getName(), $field->getLabel());
} else {
$list->setColumnLabel($field->getName(), $field->getLabel());
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions lib/manager/field.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ public function isSearchable()
return false;
}

public function isSortable(): bool
{
return $this->getObject()->isSortable();
}

public function isHiddenInListDisabled()
{
if (!isset($this->definitions['is_hiddeninlist'])) {
Expand Down
5 changes: 5 additions & 0 deletions lib/yform/base_abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,10 @@ public function isDeprecated(): bool
return false;
}

public function isSortable(): bool
{
return true;
}

public function init() {}
}
6 changes: 6 additions & 0 deletions lib/yform/value/be_manager_relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -885,4 +885,10 @@ private static function getRelationTableFieldsForTables($mainTable, $relationTab

return ['source' => reset($source)->getName(), 'target' => reset($target)->getName()];
}

public function isSortable(): bool
{
return false;
}

}

0 comments on commit 819a7a1

Please sign in to comment.