You are here

public function Visualization::build_sort in Visualization API 8

Adds sorting to the individual fields.

File

src/Plugin/views/style/Visualization.php, line 173
Definition of Drupal\visualization\Plugin\views\style\Visualization.

Class

Visualization
Style plugin uses views ui to configure views data for rendering charts.

Namespace

Drupal\visualization\Plugin\views\style

Code

public function build_sort() {
  foreach ($this->options['fields'] as $field => $option) {
    $handler = $this->displayHandler->handlers['field'][$field];
    if ($option['sort'] && $handler
      ->click_sortable()) {
      $handler
        ->click_sort($option['sort']);
    }
  }
  return FALSE;
}