summaryrefslogtreecommitdiff
path: root/framework/Data/ActiveRecord
diff options
context:
space:
mode:
authorwei <>2007-05-09 08:35:52 +0000
committerwei <>2007-05-09 08:35:52 +0000
commit3261f4dcadf1e7aa45446153f654b20530c950b9 (patch)
tree1f34edf5af76c1ec41c5eeb8d6a7d465e5cbbef0 /framework/Data/ActiveRecord
parenta49bb746445974a692cbc00f32dd167cabaaf030 (diff)
Update northwind db
Diffstat (limited to 'framework/Data/ActiveRecord')
-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();
}