\TbExtendedFilter

## Extended filter for grids.

This widget displays an extra row to the grid is attached to and renders a visual feedback of the filter values used plus an option to save them for later use.

Summary

Methods
Properties
Constants
init()
run()
registerClientScript()
$model
$grid
$saveFilterVar
$removeFilterVar
$filteredBy
$redirectRoute
No constants found
checkRequestRemovalFilter()
checkRequestFilters()
displaySaveButton()
displaySavedFilters()
generateRegistryItemKey()
displayExtendedFilterValues()
$registry
$jsonStorage
N/A
No private methods found
No private properties found
N/A

Properties

$model

$model : \CActiveRecord

Type

\CActiveRecord — the model that works as a filter to the grid

$grid

$grid : \CGridView

Type

\CGridView — the grid view the widget is going to be used with

$saveFilterVar

$saveFilterVar : string

Type

string — the ajax variable that is used to check whether a filter is to be saved

$removeFilterVar

$removeFilterVar : string

Type

string — the ajax variable that is used to check whether to delete a filter from the registry

$filteredBy

$filteredBy : array

Type

array — the cleaned filter attributes

$redirectRoute

$redirectRoute : array

Type

array — the route to redirect when saving/removing a filter

$registry

$registry : string

Type

string — the name of the json registry to save the value

$jsonStorage

$jsonStorage : \JSONStorage

Type

\JSONStorage — Component

Methods

init()

init()

### .init()

Widget initialization

Throws

\CException

run()

run()

### .run()

Widget's run method

registerClientScript()

registerClientScript()

### .registerClientScript()

Registers the required

checkRequestRemovalFilter()

checkRequestRemovalFilter()

### .checkRequestRemovalFilter()

Checks whether there has been send the command to remove a filter from the registry and redirects to specified route

checkRequestFilters()

checkRequestFilters() : bool

### .checkRequestFilters()

Checkes whether there has been send the command to save a filter to the registry and redirects to specified route

Returns

bool

displaySaveButton()

displaySaveButton(string $registryKey)

### .displaySaveButton()

Displays the save filter button

Parameters

string $registryKey

displaySavedFilters()

displaySavedFilters(string $registryKey)

### .displaySavedFilters()

displays the saved filters as a dropdown list

Parameters

string $registryKey

generateRegistryItemKey()

generateRegistryItemKey() : null|string

### .generateRegistryItemKey()

Generates a registry item key with the filtered attributes + the grid id

Returns

null|string

displayExtendedFilterValues()

displayExtendedFilterValues(array $filteredBy) : string

### .displayExtendedFilterValues()

Displays the filtered options

Parameters

array $filteredBy

Returns

string