public function onFilterGetOptions()
    {
        $this->defineFilterScopes();

        $searchQuery = post('search');
        if (!$scopeName = post('scopeName')) {
            return;
        }

        $scope = $this->getScope($scopeName);
        $activeKeys = $scope->value ? array_keys($scope->value) : [];
        $available = $this->getAvailableOptions($scope, $searchQuery);
        $active = $searchQuery ? [] : $this->filterActiveOptions($activeKeys, $available);

        return [
            'scopeName' => $scopeName,
            'options' => [
                'available' => $this->optionsToAjax($available),
                'active'    => $this->optionsToAjax($active),
            ]
        ];
    }
public function onFilterGetOptions()
    {
        $this->defineFilterScopes();

        $searchQuery = post('search');
        if (!$scopeName = post('scopeName')) {
            return;
        }

        $scope = $this->getScope($scopeName);
        $activeKeys = $scope->value ? array_keys($scope->value) : [];
        $available = $this->getAvailableOptions($scope, $searchQuery);
        $active = $searchQuery ? [] : $this->filterActiveOptions($activeKeys, $available);

        return [
            'scopeName' => $scopeName,
            'options' => [
                'available' => $this->optionsToAjax($available),
                'active'    => $this->optionsToAjax($active),
            ]
        ];
    }
public function onFilterGetOptions ( ) { $ this -> defineFilterScopes ( ) ; $ searchQuery = post ( 'search' ) ; if ( ! $ scopeName = post ( 'scopeName' ) ) { return ; } $ scope = $ this -> getScope ( $ scopeName ) ; $ activeKeys = $ scope -> value ? array_keys ( $ scope -> value ) : [ ] ; $ available = $ this -> getAvailableOptions ( $ scope , $ searchQuery ) ; $ active = $ searchQuery ? [ ] : $ this -> filterActiveOptions ( $ activeKeys , $ available ) ; return [ 'scopeName' => $ scopeName , 'options' => [ 'available' => $ this -> optionsToAjax ( $ available ) , 'active' => $ this -> optionsToAjax ( $ active ) , ] ] ; }
Returns available options for group scope type.
@return array
Returns available options for group scope type .