|
@@ -57,7 +57,11 @@ class TableAjax extends ViewAjax {
|
|
|
public function setRootUrl($rootUrl) { $this->rootUrl = $rootUrl; }
|
|
public function setRootUrl($rootUrl) { $this->rootUrl = $rootUrl; }
|
|
|
|
|
|
|
|
private function _hasStateFilterInit() {
|
|
private function _hasStateFilterInit() {
|
|
|
- return array_key_exists($this->_htmlID, $_SESSION['TableAjax_Cache']) && array_key_exists('_filterInit', $_SESSION['TableAjax_Cache'][$this->_htmlID]);
|
|
|
|
|
|
|
+ return (
|
|
|
|
|
+ array_key_exists($this->_htmlID, $_SESSION['TableAjax_Cache'])
|
|
|
|
|
+ && array_key_exists('_filterInit', $_SESSION['TableAjax_Cache'][$this->_htmlID])
|
|
|
|
|
+ && !empty((array)$_SESSION['TableAjax_Cache'][$this->_htmlID]['_filterInit'])
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// TODO: read state from cache by key $this->_htmlID
|
|
// TODO: read state from cache by key $this->_htmlID
|
|
@@ -84,6 +88,7 @@ class TableAjax extends ViewAjax {
|
|
|
$this->_label = $v;
|
|
$this->_label = $v;
|
|
|
break;
|
|
break;
|
|
|
case '_filterInit':
|
|
case '_filterInit':
|
|
|
|
|
+ // DBG::log([ '$this->_filterInit' => $this->_filterInit ], 'array', "TODO:BUG?:filters");
|
|
|
$this->_filterInit = $v;
|
|
$this->_filterInit = $v;
|
|
|
break;
|
|
break;
|
|
|
case '_rowFunctions':
|
|
case '_rowFunctions':
|
|
@@ -131,6 +136,7 @@ class TableAjax extends ViewAjax {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function setFilterInit($filterInit) {
|
|
public function setFilterInit($filterInit) {
|
|
|
|
|
+ // DBG::log([ '$this->_filterInit' => $this->_filterInit, 'hasFiltersInit' => $this->_hasStateFilterInit() ], 'array', "TODO:BUG?:filters - setFilterInit");
|
|
|
if ($this->_hasStateFilterInit()) {
|
|
if ($this->_hasStateFilterInit()) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -147,10 +153,11 @@ class TableAjax extends ViewAjax {
|
|
|
|
|
|
|
|
private function setFilters($filterInit) {
|
|
private function setFilters($filterInit) {
|
|
|
$this->_filterInit = (object)$filterInit;
|
|
$this->_filterInit = (object)$filterInit;
|
|
|
|
|
+ // DBG::log([ '$this->_filterInit' => $this->_filterInit ], 'array', "TODO:BUG?:filters - setFilters");
|
|
|
$this->_saveState();
|
|
$this->_saveState();
|
|
|
}
|
|
}
|
|
|
function getFilters() {
|
|
function getFilters() {
|
|
|
- return $this->_filterInit;
|
|
|
|
|
|
|
+ return (array)$this->_filterInit;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function setRowFunctions($functions) {
|
|
public function setRowFunctions($functions) {
|