diff options
author | wei <> | 2007-05-03 00:48:04 +0000 |
---|---|---|
committer | wei <> | 2007-05-03 00:48:04 +0000 |
commit | 1ae09931b2572d9c3067c99f841a60cb3330b3f3 (patch) | |
tree | 0b263b594bfa9c2bf5b37d2d565b4583f796bf2c /framework/Data/ActiveRecord/Scaffold | |
parent | 24bdc94145c11744f624149a0dbdd10e3d5ca4cd (diff) |
Update active relations docs
Diffstat (limited to 'framework/Data/ActiveRecord/Scaffold')
3 files changed, 9 insertions, 14 deletions
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php index e1d57124..84c381f0 100644 --- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php +++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php @@ -190,6 +190,7 @@ class TScaffoldInputCommon extends TScaffoldInputBase {
$value = $this->getRecordPropertyValue($column, $record);
$control = new TDatePicker();
+ $control->setFromYear(1900);
$control->setInputMode(TDatePickerInputMode::DropDownList);
$control->setDateFormat('yyyy-MM-dd');
if(!empty($value))
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php index 71dc83cd..34f8a592 100644 --- a/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php +++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php @@ -51,16 +51,6 @@ Prado::using('System.Data.ActiveRecord.Scaffold.TScaffoldBase'); class TScaffoldListView extends TScaffoldBase
{
/**
- * Initialize the sort drop down list in non post back mode (i.e. GET requests).
- */
- public function onLoad($param)
- {
- parent::onLoad($param);
- if(!$this->getPage()->getIsPostBack())
- $this->initializeSort();
- }
-
- /**
* Initialize the sort drop down list and the column names repeater.
*/
protected function initializeSort()
@@ -87,6 +77,8 @@ class TScaffoldListView extends TScaffoldBase public function onPreRender($param)
{
parent::onPreRender($param);
+ if(!$this->getPage()->getIsPostBack())
+ $this->initializeSort();
$this->loadRecordData();
}
@@ -113,8 +105,10 @@ class TScaffoldListView extends TScaffoldBase if($offset + $limit > $total)
$limit = $total - $offset;
$criteria = new TActiveRecordCriteria($this->getSearchCondition(), $this->getSearchParameters());
- $criteria->setLimit($limit);
- $criteria->setOffset($offset);
+ if($limit > 0)
+ $criteria->setLimit($limit);
+ if($offset <= $total)
+ $criteria->setOffset($offset);
$order = explode(' ',$this->_sort->getSelectedValue(), 2);
if(is_array($order) && count($order) === 2)
$criteria->OrdersBy[$order[0]] = $order[1];
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php index c144fe37..ad7ba55d 100644 --- a/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php +++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php @@ -44,9 +44,9 @@ class TScaffoldView extends TScaffoldBase /**
* Copy basic record details to the list/edit/search controls.
*/
- public function onLoad($param)
+ public function onPreRender($param)
{
- parent::onLoad($param);
+ parent::onPreRender($param);
$this->getListView()->copyFrom($this);
$this->getEditView()->copyFrom($this);
$this->getSearchControl()->copyFrom($this);
|