PHP 클래스 Prado\Web\UI\WebControls\TPager

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. When the pager mode is either NextPrev or Numeric, the paging buttons may be displayed in three types by setting {@link setButtonType ButtonType}: - LinkButton: a hyperlink button - PushButton: a normal button - ImageButton: an image button (please set XXXPageImageUrl properties accordingly to specify the button images.) Since Prado 3.2.1, you can use the {@link setButtonCssClass ButtonCssClass} property to specify a css class that will be applied to each button created by the pager in NextPrev or Numeric mode. 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.
부터: 3.0.2
저자: Qiang Xue ([email protected])
상속: extends TWebControl, implements Prado\Web\UI\INamingContainer
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
bubbleEvent ( $sender, $param ) : boolean Processes a bubbled event.
getButtonCssClass ( ) : string
getButtonType ( ) : TPagerButtonType
getControlToPaginate ( ) : string
getCurrentPageIndex ( ) : integer
getFirstPageImageUrl ( ) : string
getFirstPageText ( ) : string
getIsFirstPage ( ) : boolean
getIsLastPage ( ) : boolean
getLastPageImageUrl ( ) : string
getLastPageText ( ) : string
getMode ( ) : TPagerMode
getNextPageImageUrl ( ) : string
getNextPageText ( ) : string
getNumericPageImageUrl ( ) : string
getPageButtonCount ( ) : integer
getPageCount ( ) : integer
getPrevPageImageUrl ( ) : string
getPrevPageText ( ) : string
listIndexChanged ( $sender, $param ) Event handler to the OnSelectedIndexChanged event of the dropdown list.
loadState ( ) Restores the pager state.
onPageIndexChanged ( $param ) This event is raised when page index is changed due to a page button click.
onPreRender ( $param ) Performs databinding to populate data items from data source.
render ( $writer ) Renders the control.
setButtonCssClass ( $value )
setButtonType ( $value )
setControlToPaginate ( $value ) Sets the ID path of the control whose content would be paginated.
setFirstPageImageUrl ( $value )
setFirstPageText ( $value )
setLastPageImageUrl ( $value )
setLastPageText ( $value )
setMode ( $value )
setNextPageImageUrl ( $value )
setNextPageText ( $value )
setNumericPageImageUrl ( $value ) Sets the image URL for the numeric page buttons.
setPageButtonCount ( $value )
setPrevPageImageUrl ( $value )
setPrevPageText ( $value )

보호된 메소드들

메소드 설명
buildListPager ( ) Builds a dropdown list pager
buildNextPrevPager ( ) Builds a next-prev pager
buildNumericPager ( ) Builds a numeric pager
buildPager ( ) Builds the pager content based on the pager mode.
createPagerButton ( $buttonType, $enabled, $text, $commandName, $commandParameter ) : mixed Creates a pager button.
getPageImageUrl ( $text, $commandName )
setCurrentPageIndex ( $value )
setPageCount ( $value )

메소드 상세

bubbleEvent() 공개 메소드

This method overrides parent's implementation by wrapping event parameter for OnCommand event with item information.
public bubbleEvent ( $sender, $param ) : boolean
리턴 boolean whether the event bubbling should stop here.

buildListPager() 보호된 메소드

Builds a dropdown list pager
protected buildListPager ( )

buildNextPrevPager() 보호된 메소드

Builds a next-prev pager
protected buildNextPrevPager ( )

buildNumericPager() 보호된 메소드

Builds a numeric pager
protected buildNumericPager ( )

buildPager() 보호된 메소드

Current implementation includes building 'NextPrev', 'Numeric' and 'DropDownList' pagers. Derived classes may override this method to provide additional pagers.
protected buildPager ( )

createPagerButton() 보호된 메소드

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.
protected createPagerButton ( $buttonType, $enabled, $text, $commandName, $commandParameter ) : mixed
리턴 mixed the button instance

getButtonCssClass() 공개 메소드

부터: 3.2.1
public getButtonCssClass ( ) : string
리턴 string the css class of the buttons.

getButtonType() 공개 메소드

public getButtonType ( ) : TPagerButtonType
리턴 TPagerButtonType the type of command button for paging. Defaults to TPagerButtonType::LinkButton.

getControlToPaginate() 공개 메소드

public getControlToPaginate ( ) : string
리턴 string the ID path of the control whose content would be paginated.

getCurrentPageIndex() 공개 메소드

public getCurrentPageIndex ( ) : integer
리턴 integer the zero-based index of the current page. Defaults to 0.

getFirstPageImageUrl() 공개 메소드

부터: 3.1.1
public getFirstPageImageUrl ( ) : string
리턴 string the image URL for the first page button. This is only used when {@link getButtonType ButtonType} is 'ImageButton'.

getFirstPageText() 공개 메소드

public getFirstPageText ( ) : string
리턴 string text for the first page button. Defaults to '<<'.

getIsFirstPage() 공개 메소드

public getIsFirstPage ( ) : boolean
리턴 boolean whether the current page is the first page Defaults to false.

getIsLastPage() 공개 메소드

public getIsLastPage ( ) : boolean
리턴 boolean whether the current page is the last page

getLastPageImageUrl() 공개 메소드

부터: 3.1.1
public getLastPageImageUrl ( ) : string
리턴 string the image URL for the last page button. This is only used when {@link getButtonType ButtonType} is 'ImageButton'.

getLastPageText() 공개 메소드

public getLastPageText ( ) : string
리턴 string text for the last page button. Defaults to '>>'.

getMode() 공개 메소드

public getMode ( ) : TPagerMode
리턴 TPagerMode pager mode. Defaults to TPagerMode::NextPrev.

getNextPageImageUrl() 공개 메소드

부터: 3.1.1
public getNextPageImageUrl ( ) : string
리턴 string the image URL for the next page button. This is only used when {@link getButtonType ButtonType} is 'ImageButton'.

getNextPageText() 공개 메소드

public getNextPageText ( ) : string
리턴 string text for the next page button. Defaults to '>'.

getNumericPageImageUrl() 공개 메소드

또한 보기: setNumericPageImageUrl
부터: 3.1.1
public getNumericPageImageUrl ( ) : string
리턴 string the image URL for the numeric page buttons. This is only used when {@link getButtonType ButtonType} is 'ImageButton' and {@link getMode Mode} is 'Numeric'.

getPageButtonCount() 공개 메소드

public getPageButtonCount ( ) : integer
리턴 integer maximum number of pager buttons to be displayed. Defaults to 10.

getPageCount() 공개 메소드

public getPageCount ( ) : integer
리턴 integer number of pages of data items available

getPageImageUrl() 보호된 메소드

부터: 3.1.1
protected getPageImageUrl ( $text, $commandName )

getPrevPageImageUrl() 공개 메소드

부터: 3.1.1
public getPrevPageImageUrl ( ) : string
리턴 string the image URL for the previous page button. This is only used when {@link getButtonType ButtonType} is 'ImageButton'.

getPrevPageText() 공개 메소드

public getPrevPageText ( ) : string
리턴 string text for the previous page button. Defaults to '<'.

listIndexChanged() 공개 메소드

This handler will raise {@link onPageIndexChanged OnPageIndexChanged} event.
public listIndexChanged ( $sender, $param )

loadState() 공개 메소드

This method overrides the parent implementation and is invoked when the control is loading persistent state.
public loadState ( )

onPageIndexChanged() 공개 메소드

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

onPreRender() 공개 메소드

This method is invoked by {@link dataBind()}. You may override this function to provide your own way of data population.
public onPreRender ( $param )

render() 공개 메소드

The method overrides the parent implementation by rendering the pager only when there are two or more pages.
public render ( $writer )

setButtonCssClass() 공개 메소드

부터: 3.2.1
public setButtonCssClass ( $value )

setButtonType() 공개 메소드

public setButtonType ( $value )

setControlToPaginate() 공개 메소드

The ID path is the dot-connected IDs of the controls reaching from the pager's naming container to the target control.
public setControlToPaginate ( $value )

setCurrentPageIndex() 보호된 메소드

protected setCurrentPageIndex ( $value )

setFirstPageImageUrl() 공개 메소드

부터: 3.1.1
public setFirstPageImageUrl ( $value )

setFirstPageText() 공개 메소드

public setFirstPageText ( $value )

setLastPageImageUrl() 공개 메소드

부터: 3.1.1
public setLastPageImageUrl ( $value )

setLastPageText() 공개 메소드

public setLastPageText ( $value )

setMode() 공개 메소드

public setMode ( $value )

setNextPageImageUrl() 공개 메소드

부터: 3.1.1
public setNextPageImageUrl ( $value )

setNextPageText() 공개 메소드

public setNextPageText ( $value )

setNumericPageImageUrl() 공개 메소드

This is actually a template for generating a set of URLs corresponding to numeric button 1, 2, 3, .., etc. Use {0} as the placeholder for the numbers. For example, the image URL http://example.com/images/button{0}.gif will be replaced as http://example.com/images/button1.gif, http://example.com/images/button2.gif, etc.
부터: 3.1.1
public setNumericPageImageUrl ( $value )

setPageButtonCount() 공개 메소드

public setPageButtonCount ( $value )

setPageCount() 보호된 메소드

protected setPageCount ( $value )

setPrevPageImageUrl() 공개 메소드

부터: 3.1.1
public setPrevPageImageUrl ( $value )

setPrevPageText() 공개 메소드

public setPrevPageText ( $value )