[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/framework/Web/UI/WebControls/ -> TPager.php (sommaire)

TPager class file.

Author: Qiang Xue <qiang.xue@gmail.com>
Copyright: Copyright © 2005 PradoSoft
License: http://www.pradosoft.com/license/
Version: $Id: TPager.php 1515 2006-11-26 20:09:44Z xue $
Poids: 659 lignes (20 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 4 classes

TPager:: (33 méthodes):
  loadState()
  getControlToPaginate()
  setControlToPaginate()
  getMode()
  setMode()
  getButtonType()
  setButtonType()
  getNextPageText()
  setNextPageText()
  getPrevPageText()
  setPrevPageText()
  getFirstPageText()
  setFirstPageText()
  getLastPageText()
  setLastPageText()
  getPageButtonCount()
  setPageButtonCount()
  getCurrentPageIndex()
  setCurrentPageIndex()
  getPageCount()
  setPageCount()
  getIsFirstPage()
  getIsLastPage()
  onPreRender()
  render()
  buildPager()
  createPagerButton()
  buildNextPrevPager()
  buildNumericPager()
  buildListPager()
  listIndexChanged()
  onPageIndexChanged()
  bubbleEvent()

TPagerPageChangedEventParameter:: (3 méthodes):
  __construct()
  getCommandSource()
  getNewPageIndex()

TPagerMode:: (0 méthodes):

TPagerButtonType:: (0 méthodes):


Classe: TPager  - X-Ref

TPager class.

TPager creates a pager that provides UI for end-users to interactively
specify which page of data to be rendered in a {@link TDataBoundControl}-derived control,
such as {@link TDataList}, {@link TRepeater}, {@link TCheckBoxList}, etc.
The target data-bound control is specified by {@link setControlToPaginate ControlToPaginate},
which must be the ID path of the target control reaching from the pager's
naming container. Note, the target control must have its {@link TDataBoundControl::setAllowPaging AllowPaging}
set to true.

TPager can display three different UIs, specified via {@link setMode Mode}:
- NextPrev: a next page and a previous page button are rendered.
- Numeric: a list of page index buttons are rendered.
- List: a dropdown list of page indices are rendered.

TPager raises an {@link onPageIndexChanged OnPageIndexChanged} event when
the end-user interacts with it and specifies a new page (e.g. clicking
on a page button that leads to a new page.) The new page index may be obtained
from the event parameter's property {@link TPagerPageChangedEventParameter::getNewPageIndex NewPageIndex}.
Normally, in the event handler, one can set the {@link TDataBoundControl::getCurrentPageIndex CurrentPageIndex}
to this new page index so that the new page of data is rendered.

Multiple pagers can be associated with the same data-bound control.

loadState()   X-Ref
Restores the pager state.
This method overrides the parent implementation and is invoked when
the control is loading persistent state.


getControlToPaginate()   X-Ref

return: string the ID path of the control whose content would be paginated.

setControlToPaginate($value)   X-Ref
Sets the ID path of the control whose content would be paginated.
The ID path is the dot-connected IDs of the controls reaching from
the pager's naming container to the target control.

param: string the ID path

getMode()   X-Ref

return: TPagerMode pager mode. Defaults to TPagerMode::NextPrev.

setMode($value)   X-Ref

param: TPagerMode pager mode.

getButtonType()   X-Ref

return: TPagerButtonType the type of command button for paging. Defaults to TPagerButtonType::LinkButton.

setButtonType($value)   X-Ref

param: TPagerButtonType the type of command button for paging.

getNextPageText()   X-Ref

return: string text for the next page button. Defaults to '>'.

setNextPageText($value)   X-Ref

param: string text for the next page button.

getPrevPageText()   X-Ref

return: string text for the previous page button. Defaults to '<'.

setPrevPageText($value)   X-Ref

param: string text for the next page button.

getFirstPageText()   X-Ref

return: string text for the first page button. Defaults to '<<'.

setFirstPageText($value)   X-Ref

param: string text for the first page button. If empty, the first page button will not be rendered.

getLastPageText()   X-Ref

return: string text for the last page button. Defaults to '>>'.

setLastPageText($value)   X-Ref

param: string text for the last page button. If empty, the last page button will not be rendered.

getPageButtonCount()   X-Ref

return: integer maximum number of pager buttons to be displayed. Defaults to 10.

setPageButtonCount($value)   X-Ref

param: integer maximum number of pager buttons to be displayed

getCurrentPageIndex()   X-Ref

return: integer the zero-based index of the current page. Defaults to 0.

setCurrentPageIndex($value)   X-Ref

param: integer the zero-based index of the current page

getPageCount()   X-Ref

return: integer number of pages of data items available

setPageCount($value)   X-Ref

param: integer number of pages of data items available

getIsFirstPage()   X-Ref

return: boolean whether the current page is the first page Defaults to false.

getIsLastPage()   X-Ref

return: boolean whether the current page is the last page

onPreRender($param)   X-Ref
Performs databinding to populate data items from data source.
This method is invoked by {@link dataBind()}.
You may override this function to provide your own way of data population.

param: Traversable the bound data

render($writer)   X-Ref
Renders the control.
The method overrides the parent implementation by rendering
the pager only when there are two or more pages.

param: THtmlWriter the writer

buildPager()   X-Ref
Builds the pager content based on the pager mode.
Current implementation includes building 'NextPrev', 'Numeric' and 'DropDownList' pagers.
Derived classes may override this method to provide additional pagers.


createPagerButton($buttonType,$enabled,$text,$commandName,$commandParameter)   X-Ref
Creates a pager button.
Depending on the button type, a TLinkButton or a TButton may be created.
If it is enabled (clickable), its command name and parameter will also be set.
Derived classes may override this method to create additional types of buttons, such as TImageButton.

param: string button type, either LinkButton or PushButton
param: boolean whether the button should be enabled
param: string caption of the button
param: string CommandName corresponding to the OnCommand event of the button
param: string CommandParameter corresponding to the OnCommand event of the button
return: mixed the button instance

buildNextPrevPager()   X-Ref
Builds a next-prev pager


buildNumericPager()   X-Ref
Builds a numeric pager


buildListPager()   X-Ref
Builds a dropdown list pager


listIndexChanged($sender,$param)   X-Ref
Event handler to the OnSelectedIndexChanged event of the dropdown list.
This handler will raise {@link onPageIndexChanged OnPageIndexChanged} event.

param: TDropDownList the dropdown list control raising the event
param: TEventParameter event parameter

onPageIndexChanged($param)   X-Ref
This event is raised when page index is changed due to a page button click.

param: TPagerPageChangedEventParameter event parameter

bubbleEvent($sender,$param)   X-Ref
Processes a bubbled event.
This method overrides parent's implementation by wrapping event parameter
for <b>OnCommand</b> event with item information.

param: TControl the sender of the event
param: TEventParameter event parameter
return: boolean whether the event bubbling should stop here.

Classe: TPagerPageChangedEventParameter  - X-Ref

TPagerPageChangedEventParameter class

TPagerPageChangedEventParameter encapsulates the parameter data for
{@link TPager::onPageIndexChanged PageIndexChanged} event of {@link TPager} controls.

The {@link getCommandSource CommandSource} property refers to the control
that originally raises the OnCommand event, while {@link getNewPageIndex NewPageIndex}
returns the new page index carried with the page command.

__construct($source,$newPageIndex)   X-Ref
Constructor.

param: TControl the control originally raises the <b>OnCommand</b> event.
param: integer new page index

getCommandSource()   X-Ref

return: TControl the control originally raises the <b>OnCommand</b> event.

getNewPageIndex()   X-Ref

return: integer new page index

Classe: TPagerMode  - X-Ref

TPagerMode class.
TPagerMode defines the enumerable type for the possible modes that a {@link TPager} control can take.

The following enumerable values are defined:
- NextPrev: pager buttons are displayed as next and previous pages
- Numeric: pager buttons are displayed as numeric page numbers
- DropDownList: a dropdown list is used to select pages

Classe: TPagerButtonType  - X-Ref

TPagerButtonType class.
TPagerButtonType defines the enumerable type for the possible types of pager buttons.

The following enumerable values are defined:
- LinkButton: link buttons
- PushButton: form submit buttons



Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7