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.
getCurrentPageIndex()
public method
getFirstPageImageUrl()
public method
public getFirstPageImageUrl ( ) : string |
return |
string |
the image URL for the first page button. This is only used when {@link getButtonType ButtonType} is 'ImageButton'. |
getFirstPageText()
public method
getIsFirstPage()
public method
getIsLastPage()
public method
getLastPageImageUrl()
public method
public getLastPageImageUrl ( ) : string |
return |
string |
the image URL for the last page button. This is only used when {@link getButtonType ButtonType} is 'ImageButton'. |
getLastPageText()
public method
getNextPageImageUrl()
public method
public getNextPageImageUrl ( ) : string |
return |
string |
the image URL for the next page button. This is only used when {@link getButtonType ButtonType} is 'ImageButton'. |
getNextPageText()
public method
getNumericPageImageUrl()
public method
public getNumericPageImageUrl ( ) : string |
return |
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'. |
getPageCount()
public method
getPageImageUrl()
protected method
getPrevPageImageUrl()
public method
public getPrevPageImageUrl ( ) : string |
return |
string |
the image URL for the previous page button. This is only used when {@link getButtonType ButtonType} is 'ImageButton'. |
getPrevPageText()
public method
onPageIndexChanged()
public method
This event is raised when page index is changed due to a page button click.
setCurrentPageIndex()
protected method
setFirstPageImageUrl()
public method
setFirstPageText()
public method
setLastPageImageUrl()
public method
setLastPageText()
public method
setNextPageImageUrl()
public method
setNextPageText()
public method
setNumericPageImageUrl()
public method
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.
setPageCount()
protected method
setPrevPageImageUrl()
public method
setPrevPageText()
public method