PHP 클래스 kop\y2sp\ScrollPager

ScrollPager works with a [[Pagination]] object which specifies the totally number of pages and the current page number.
Example usage: echo ListView::widget([ 'dataProvider' => $dataProvider, 'itemOptions' => ['class' => 'item'], 'itemView' => '_item_view', 'pager' => ['class' => \kop\y2sp\ScrollPager::className()] ]); This widget is using {@link http://infiniteajaxscroll.com/ JQuery Infinite Ajax Scroll plugin}.
저자: Ivan Koptiev ([email protected])
상속: extends yii\base\Widget
파일 보기 프로젝트 열기: kop/yii2-scroll-pager 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$container string Enter the selector of the element containing your items that you want to paginate.
$delay integer Minimal number of milliseconds to stay in a loading state.
$enabledExtensions array The list of the enabled plugin extensions.
$eventOnLoad string | yii\web\JsExpression Triggered when a new url will be loaded from the server.
$eventOnLoaded string | yii\web\JsExpression Triggered after a new page was loaded from the server.
$eventOnNext string | yii\web\JsExpression Triggered when the next page should be loaded. Happens before loading of the next page starts. With this event it is possible to cancel the loading of the next page. You can do this by returning false from your callback.
$eventOnNoneLeft string | yii\web\JsExpression Triggered when there are no more pages left.
$eventOnPageChange string | yii\web\JsExpression Triggered when a used scroll to another page.
$eventOnReady string | yii\web\JsExpression Triggered when IAS and all the extensions have been initialized.
$eventOnRender string | yii\web\JsExpression Triggered before new items will be rendered.
$eventOnRendered string | yii\web\JsExpression Triggered after new items have rendered. Note: This event is only fired once.
$eventOnScroll string | yii\web\JsExpression Triggered when the visitors scrolls.
$historyPrev string Enter the selector of the link element that links to the previous page. The href attribute of this element will be used to get the items from the previous page. Make sure there is only one element that matches the selector.
$item string Enter the selector of the element that each item has. Make sure the elements are inside the container element.
$negativeMargin integer
$next string Enter the selector of the link element that links to the next page. The href attribute of this element will be used to get the items from the next page. Make sure there is only one(1) element that matches the selector.
$noneLeftTemplate string Allows you to override the "nothing left" message html template.
$noneLeftText string Text of the "nothing left" message. Default: "You reached the end".
$overflowContainer string A selector for "div" HTML element to use as an overflow container.
$pagination The pagination object that this pager is associated with. You must set this property in order to make ScrollPager work.
$paginationSelector string Enter the selector of the element containing the pagination.
$spinnerSrc string The src attribute of the spinner image.
$spinnerTemplate string Allows you to override the spinner html template.
$triggerOffset integer The number of pages which should load automatically. After that the trigger is shown for every subsequent page.

For example:
if you set the offset to 2, the pages 2 and 3 (page 1 is always shown) would load automatically and for every subsequent page the user has to press the trigger to load it.
$triggerTemplate string Allows you to override the trigger html template.
$triggerText string Text of trigger the link. Default: "Load more items".

공개 메소드들

메소드 설명
init ( ) Initializes the pager.
run ( ) : mixed Executes the widget.

보호된 메소드들

메소드 설명
checkEnabledExtensions ( string | array $extensions ) : boolean Check whether the given extensions are enabled.
registerAssets ( ) Register required asset bundles.
registerEventHandlers ( array $config ) Register jQuery IAS event handlers.
registerExtensions ( array $config ) Register jQuery IAS extensions.

메소드 상세

checkEnabledExtensions() 보호된 메소드

Check whether the given extensions are enabled.
protected checkEnabledExtensions ( string | array $extensions ) : boolean
$extensions string | array Single or multiple extensions names.
리턴 boolean Operation result.

init() 공개 메소드

Initializes the pager.
public init ( )

registerAssets() 보호된 메소드

You can override this method in case if you want to use your own JQuery Infinite Ajax Scroll plugin files (for example, some forked plugin version).
protected registerAssets ( )

registerEventHandlers() 보호된 메소드

This method takes jQuery IAS event handlers definition as a parameter and registers this event handlers.
protected registerEventHandlers ( array $config )
$config array jQuery IAS event handlers definition.

registerExtensions() 보호된 메소드

This method takes jQuery IAS extensions definition as a parameter and registers this extensions.
protected registerExtensions ( array $config )
$config array jQuery IAS extensions definition.

run() 공개 메소드

This overrides the parent implementation by initializing jQuery IAS and displaying the generated page buttons.
public run ( ) : mixed
리턴 mixed

프로퍼티 상세

$container 공개적으로 프로퍼티

Enter the selector of the element containing your items that you want to paginate.
public string $container
리턴 string

$delay 공개적으로 프로퍼티

Minimal number of milliseconds to stay in a loading state.
public int $delay
리턴 integer

$enabledExtensions 공개적으로 프로퍼티

The list of the enabled plugin extensions.
public array $enabledExtensions
리턴 array

$eventOnLoad 공개적으로 프로퍼티

Triggered when a new url will be loaded from the server.
또한 보기: http://infiniteajaxscroll.com/docs/events.html
public string|JsExpression,yii\web $eventOnLoad
리턴 string | yii\web\JsExpression

$eventOnLoaded 공개적으로 프로퍼티

Triggered after a new page was loaded from the server.
또한 보기: http://infiniteajaxscroll.com/docs/events.html
public string|JsExpression,yii\web $eventOnLoaded
리턴 string | yii\web\JsExpression

$eventOnNext 공개적으로 프로퍼티

Triggered when the next page should be loaded. Happens before loading of the next page starts. With this event it is possible to cancel the loading of the next page. You can do this by returning false from your callback.
또한 보기: http://infiniteajaxscroll.com/docs/events.html
public string|JsExpression,yii\web $eventOnNext
리턴 string | yii\web\JsExpression

$eventOnNoneLeft 공개적으로 프로퍼티

Triggered when there are no more pages left.
또한 보기: http://infiniteajaxscroll.com/docs/events.html
public string|JsExpression,yii\web $eventOnNoneLeft
리턴 string | yii\web\JsExpression

$eventOnPageChange 공개적으로 프로퍼티

Triggered when a used scroll to another page.
또한 보기: http://infiniteajaxscroll.com/docs/extension-paging.html
public string|JsExpression,yii\web $eventOnPageChange
리턴 string | yii\web\JsExpression

$eventOnReady 공개적으로 프로퍼티

Triggered when IAS and all the extensions have been initialized.
또한 보기: http://infiniteajaxscroll.com/docs/events.html
public string|JsExpression,yii\web $eventOnReady
리턴 string | yii\web\JsExpression

$eventOnRender 공개적으로 프로퍼티

Triggered before new items will be rendered.
또한 보기: http://infiniteajaxscroll.com/docs/events.html
public string|JsExpression,yii\web $eventOnRender
리턴 string | yii\web\JsExpression

$eventOnRendered 공개적으로 프로퍼티

Triggered after new items have rendered. Note: This event is only fired once.
또한 보기: http://infiniteajaxscroll.com/docs/events.html
public string|JsExpression,yii\web $eventOnRendered
리턴 string | yii\web\JsExpression

$eventOnScroll 공개적으로 프로퍼티

Triggered when the visitors scrolls.
또한 보기: http://infiniteajaxscroll.com/docs/events.html
public string|JsExpression,yii\web $eventOnScroll
리턴 string | yii\web\JsExpression

$historyPrev 공개적으로 프로퍼티

Enter the selector of the link element that links to the previous page. The href attribute of this element will be used to get the items from the previous page. Make sure there is only one element that matches the selector.
public string $historyPrev
리턴 string

$item 공개적으로 프로퍼티

Enter the selector of the element that each item has. Make sure the elements are inside the container element.
public string $item
리턴 string

$negativeMargin 공개적으로 프로퍼티

public int $negativeMargin
리턴 integer

$next 공개적으로 프로퍼티

Enter the selector of the link element that links to the next page. The href attribute of this element will be used to get the items from the next page. Make sure there is only one(1) element that matches the selector.
public string $next
리턴 string

$noneLeftTemplate 공개적으로 프로퍼티

Allows you to override the "nothing left" message html template.
public string $noneLeftTemplate
리턴 string

$noneLeftText 공개적으로 프로퍼티

Text of the "nothing left" message. Default: "You reached the end".
public string $noneLeftText
리턴 string

$overflowContainer 공개적으로 프로퍼티

A selector for "div" HTML element to use as an overflow container.
또한 보기: http://infiniteajaxscroll.com/examples/overflow.html
public string $overflowContainer
리턴 string

$pagination 공개적으로 프로퍼티

The pagination object that this pager is associated with. You must set this property in order to make ScrollPager work.
public $pagination

$paginationSelector 공개적으로 프로퍼티

Enter the selector of the element containing the pagination.
public string $paginationSelector
리턴 string

$spinnerSrc 공개적으로 프로퍼티

The src attribute of the spinner image.
public string $spinnerSrc
리턴 string

$spinnerTemplate 공개적으로 프로퍼티

Allows you to override the spinner html template.
public string $spinnerTemplate
리턴 string

$triggerOffset 공개적으로 프로퍼티

The number of pages which should load automatically. After that the trigger is shown for every subsequent page.

For example:
if you set the offset to 2, the pages 2 and 3 (page 1 is always shown) would load automatically and for every subsequent page the user has to press the trigger to load it.
public int $triggerOffset
리턴 integer

$triggerTemplate 공개적으로 프로퍼티

Allows you to override the trigger html template.
public string $triggerTemplate
리턴 string

$triggerText 공개적으로 프로퍼티

Text of trigger the link. Default: "Load more items".
public string $triggerText
리턴 string