- Home
- About
- Testimonials
- Demos
- Download
- Documentation
- Blogs
- Forum
- Support

Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml
Classes:
TAttributeCollection
TDummyDataSource
TDummyDataSourceIterator
TList
TListIterator
TMap
TMapIterator
TPagedDataSource
TPagedList
TPagedListFetchDataEventParameter
TPagedListIterator
TPagedListPageChangedEventParameter
TPagedMapIterator
TQueue
TQueueIterator
TStack
TStackIterator

Keyword

# Class TPagedDataSource

    TComponent
       |
       --TPagedDataSource

TPagedDataSource class

TPagedDataSource implements an integer-indexed collection class with paging functionality.

Data items in TPagedDataSource can be traversed using foreach PHP statement like the following,

     foreach($pagedDataSource as $dataItem)

The data are fetched from DataSource. Only the items within the specified page will be returned and traversed.
Since: 3.0
Author: Qiang Xue <qiang.xue@gmail.com>

Method Summary
integer | count () Returns the number of items in the current page.
boolean | getAllowCustomPaging ()
boolean | getAllowPaging ()
integer | getCount ()
integer | getCurrentPageIndex ()
mixed | getDataSource ()
integer | getDataSourceCount ()
integer | getFirstIndexInPage ()
boolean | getIsFirstPage ()
boolean | getIsLastPage ()
Iterator | getIterator ()
integer | getPageCount ()
integer | getPageSize ()
integer | getVirtualItemCount ()
void | setAllowCustomPaging ( boolean $value)
void | setAllowPaging ( boolean $value)
void | setCurrentPageIndex ( integer $value)
void | setDataSource ( mixed $value)
void | setPageSize ( integer $value)
void | setVirtualItemCount ( integer $value)

Methods Inherited From TComponent

TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()

Method Details

## count

public integer count | ()

Returns the number of items in the current page.

This method is required by Countable interface.

Output
integer | number of items in the current page.
Exception

## getAllowCustomPaging

public boolean getAllowCustomPaging | ()

Output
boolean | whether to allow custom paging. Defaults to false.
Exception

## getAllowPaging

public boolean getAllowPaging | ()

Output
boolean | whether to allow paging. Defaults to false.
Exception

## getCount

public integer getCount | ()

Output
integer | number of items in current page
Exception

## getCurrentPageIndex

public integer getCurrentPageIndex | ()

Output
integer | current page index. Defaults to 0.
Exception

## getDataSource

public mixed getDataSource | ()

Output
mixed | original data source. Defaults to null.
Exception

## getDataSourceCount

public integer getDataSourceCount | ()

Output
integer | number of items in data source, if available
Exception

## getFirstIndexInPage

public integer getFirstIndexInPage | ()

Output
integer | the index of the item in data source, where the item is the first in current page
Exception

## getIsFirstPage

public boolean getIsFirstPage | ()

Output
boolean | whether the current page is the first page Defaults to false.
Exception

## getIsLastPage

public boolean getIsLastPage | ()

Output
boolean | whether the current page is the last page
Exception

## getIterator

public Iterator getIterator | ()

Output
Iterator | iterator
Exception

## getPageCount

public integer getPageCount | ()

Output
integer | number of pages
Exception

## getPageSize

public integer getPageSize | ()

Output
integer | number of items in each page. Defaults to 10.
Exception

## getVirtualItemCount

public integer getVirtualItemCount | ()

Output
integer | user-assigned number of items in data source Defaults to 0.
Exception

## setAllowCustomPaging

public void setAllowCustomPaging | (boolean $value )

Input
boolean | $value | whether to allow custom paging
Output
Exception

## setAllowPaging

public void setAllowPaging | (boolean $value )

Input
boolean | $value | whether to allow paging
Output
Exception

## setCurrentPageIndex

public void setCurrentPageIndex | (integer $value )

Input
integer | $value | current page index
Output
Exception

## setDataSource

public void setDataSource | (mixed $value )

Input
mixed | $value | original data source
Output
Exception

## setPageSize

public void setPageSize | (integer $value )

Input
integer | $value | number of items in each page
Output
Exception

## setVirtualItemCount

public void setVirtualItemCount | (integer $value )

Input
integer | $value | user-assigned number of items in data source
Output
Exception