yii\grid\GridView::getClientOptions PHP Method

getClientOptions() protected method

Returns the options for the grid view JS widget.
protected getClientOptions ( ) : array
return array the options
    protected function getClientOptions()
    {
        $filterUrl = isset($this->filterUrl) ? $this->filterUrl : Yii::$app->request->url;
        $id = $this->filterRowOptions['id'];
        $filterSelector = "#{$id} input, #{$id} select";
        if (isset($this->filterSelector)) {
            $filterSelector .= ', ' . $this->filterSelector;
        }
        return ['filterUrl' => Url::to($filterUrl), 'filterSelector' => $filterSelector];
    }

Usage Example

Example #1
0
 protected function getClientOptions()
 {
     return array_merge($this->clientOptions, parent::getClientOptions());
 }