FilterEditor: cache available columns
This commit is contained in:
parent
1d4ea88251
commit
2eb2fa51da
|
@ -30,6 +30,8 @@ class FilterEditor extends AbstractWidget
|
||||||
|
|
||||||
protected $addTo;
|
protected $addTo;
|
||||||
|
|
||||||
|
protected $cachedColumnSelect;
|
||||||
|
|
||||||
protected $preserveParams = array();
|
protected $preserveParams = array();
|
||||||
|
|
||||||
protected $ignoreParams = array();
|
protected $ignoreParams = array();
|
||||||
|
@ -368,8 +370,11 @@ class FilterEditor extends AbstractWidget
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cols = $this->arrayForSelect($this->query->getColumns());
|
if ($this->cachedColumnSelect === null) {
|
||||||
$active = $filter->getColumn();
|
$this->cachedColumnSelect = $this->arrayForSelect($this->query->getColumns());
|
||||||
|
asort($this->cachedColumnSelect);
|
||||||
|
}
|
||||||
|
$cols = $this->cachedColumnSelect;
|
||||||
$seen = false;
|
$seen = false;
|
||||||
foreach ($cols as $k => & $v) {
|
foreach ($cols as $k => & $v) {
|
||||||
$v = str_replace('_', ' ', ucfirst($v));
|
$v = str_replace('_', ' ', ucfirst($v));
|
||||||
|
|
Loading…
Reference in New Issue