FilterEditor: cache available columns

This commit is contained in:
Thomas Gelf 2014-11-15 23:43:13 +01:00
parent 1d4ea88251
commit 2eb2fa51da
1 changed files with 7 additions and 2 deletions

View File

@ -30,6 +30,8 @@ class FilterEditor extends AbstractWidget
protected $addTo;
protected $cachedColumnSelect;
protected $preserveParams = array();
protected $ignoreParams = array();
@ -368,8 +370,11 @@ class FilterEditor extends AbstractWidget
);
}
$cols = $this->arrayForSelect($this->query->getColumns());
$active = $filter->getColumn();
if ($this->cachedColumnSelect === null) {
$this->cachedColumnSelect = $this->arrayForSelect($this->query->getColumns());
asort($this->cachedColumnSelect);
}
$cols = $this->cachedColumnSelect;
$seen = false;
foreach ($cols as $k => & $v) {
$v = str_replace('_', ' ', ucfirst($v));