Skip to content

Commit

Permalink
Fixes being unable to sort table records by columns that are not show…
Browse files Browse the repository at this point in the history
…n by default
  • Loading branch information
matheuszych committed Oct 28, 2024
1 parent 88229ca commit 0160993
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ public function applyViewControls(
$view_controls = $this->getViewControls($total_count);

if ($request = $this->getRequest()) {
$view_controls = $this->applyValuesToViewcontrols($view_controls, $request);
$data = $view_controls->getData();
# This retrieves container data from the request
$data = $this->applyValuesToViewcontrols($view_controls, $request)->getData();
$range = $data[self::VIEWCONTROL_KEY_PAGINATION];
$range = ($range instanceof Range) ? $range->croppedTo($total_count ?? PHP_INT_MAX) : null;
$order = $data[self::VIEWCONTROL_KEY_ORDERING];
Expand All @@ -136,6 +136,8 @@ public function applyViewControls(
->withRange($range)
->withOrder($order)
->withSelectedOptionalColumns($data[self::VIEWCONTROL_KEY_FIELDSELECTION] ?? null);
# This retrieves the view controls that should be displayed
$view_controls = $table->applyValuesToViewcontrols($table->getViewControls($total_count), $request);
}

return [
Expand Down

0 comments on commit 0160993

Please sign in to comment.