summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
Diffstat (limited to 'framework')
-rw-r--r--framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php
index f5121a44..851bf903 100644
--- a/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php
+++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php
@@ -77,8 +77,11 @@ class TScaffoldListView extends TScaffoldBase
public function onPreRender($param)
{
parent::onPreRender($param);
- //if(!$this->getPage()->getIsPostBack())
- $this->initializeSort();
+ if(!$this->getPage()->getIsPostBack() || $this->getViewState('CurrentClass')!=$this->getRecordClass())
+ {
+ $this->initializeSort();
+ $this->setViewState('CurrentClass', $this->getRecordClass());
+ }
$this->loadRecordData();
}
@@ -87,9 +90,10 @@ class TScaffoldListView extends TScaffoldBase
*/
protected function loadRecordData()
{
+ $search = new TActiveRecordCriteria($this->getSearchCondition(), $this->getSearchParameters());
+ $this->_list->setVirtualItemCount($this->getRecordFinder()->count($search));
$finder = $this->getRecordFinder();
$criteria = $this->getRecordCriteria();
- $this->_list->setVirtualItemCount($this->getRecordFinder()->count($criteria));
$this->_list->setDataSource($finder->findAll($criteria));
$this->_list->dataBind();
}