From 045b8b2a21873b8747fde66890b094f63c095c93 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 5 Feb 2006 06:35:32 +0000 Subject: Added a demo of TDataGrid showing custom paging. --- framework/Collections/TPagedDataSource.php | 6 +++--- framework/Web/UI/WebControls/TDataGrid.php | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'framework') diff --git a/framework/Collections/TPagedDataSource.php b/framework/Collections/TPagedDataSource.php index 02c15b64..6192b1f7 100644 --- a/framework/Collections/TPagedDataSource.php +++ b/framework/Collections/TPagedDataSource.php @@ -152,7 +152,7 @@ class TPagedDataSource extends TComponent implements IteratorAggregate /** * @return integer user-assigned number of items in data source Defaults to 0. */ - public function getVirtualCount() + public function getVirtualItemCount() { return $this->_virtualCount; } @@ -160,12 +160,12 @@ class TPagedDataSource extends TComponent implements IteratorAggregate /** * @param integer user-assigned number of items in data source */ - public function setVirtualCount($value) + public function setVirtualItemCount($value) { if(($value=TPropertyValue::ensureInteger($value))>=0) $this->_virtualCount=$value; else - throw new TInvalidDataValueException('pageddatasource_virtualcount_invalid'); + throw new TInvalidDataValueException('pageddatasource_virtualitemcount_invalid'); } /** diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php index b0dafb5d..57d00ac8 100644 --- a/framework/Web/UI/WebControls/TDataGrid.php +++ b/framework/Web/UI/WebControls/TDataGrid.php @@ -79,7 +79,7 @@ Prado::using('System.Web.UI.WebControls.TTable'); * datasource. The number of pages PageCount is calculated based the item number and the * PageSize property. The datagrid will manage which section of the data source to be displayed * based on the CurrentPageIndex property. - * The second approach calculates the page number based on the VirtualCount property and + * The second approach calculates the page number based on the VirtualItemCount property and * the PageSize property. The datagrid will always display from the beginning of the datasource * upto the number of PageSize> data items. This approach is especially useful when the datasource may * contain too many data items to be managed by the datagrid efficiently. @@ -504,19 +504,19 @@ class TDataGrid extends TBaseDataList implements INamingContainer /** * @return integer virtual number of items in the grid. Defaults to 0, meaning not set. */ - public function getVirtualCount() + public function getVirtualItemCount() { - return $this->getViewState('VirtualCount',0); + return $this->getViewState('VirtualItemCount',0); } /** * @param integer virtual number of items in the grid */ - public function setVirtualCount($value) + public function setVirtualItemCount($value) { if(($value=TPropertyValue::ensureInteger($value))<0) - throw new TInvalidDataValueException('datagrid_virtualcount_invalid'); - $this->setViewState('VirtualCount',$value,0); + throw new TInvalidDataValueException('datagrid_virtualitemcount_invalid'); + $this->setViewState('VirtualItemCount',$value,0); } /** @@ -794,7 +794,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer $ds->setPageSize($this->getPageSize()); $ds->setAllowPaging($this->getAllowPaging()); $ds->setAllowCustomPaging($this->getAllowCustomPaging()); - $ds->setVirtualCount($this->getVirtualCount()); + $ds->setVirtualItemCount($this->getVirtualItemCount()); return $ds; } -- cgit v1.2.3