A
A
alex5e2016-04-09 15:14:24
Yii
alex5e, 2016-04-09 15:14:24

How to wrap ListView paginator in PJAX widget (Yii2)?

Tell me how to wrap a ListView paginator in a Pjax widget?

<?= ListView::widget([
    'dataProvider' => $dataProvider,
    'itemView' => '_details',
    'layout' => "{items}",
    'pager' => [
        'class' => 'justinvoelker\separatedpager\LinkPager',
        'options'=>['class'=>'pagination'],   // set clas name used in ui list of pagination
        'prevPageLabel' => false,   // Set the label for the "previous" page button
        'nextPageLabel' => false,   // Set the label for the "next" page button
        'firstPageLabel'=>false,   // Set the label for the "first" page button
        'lastPageLabel'=>false,    // Set the label for the "last" page button
        'nextPageCssClass'=>'next',    // Set CSS class for the "next" page button
        'prevPageCssClass'=>'prev',    // Set CSS class for the "previous" page button
        'firstPageCssClass'=>'first',    // Set CSS class for the "first" page button
        'lastPageCssClass'=>'last',    // Set CSS class for the "last" page button
        'maxButtonCount'=>8,    // Set maximum number of page buttons that can be displayed
        'activePageAsLink' => false,
    ],
]);
?>

The option to put the entire ListView in PJAX does not work.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2016-04-09
@webinar Yii Tag Curator

Do you want the pages to change but not the content? Otherwise, understand "Tell me how to wrap a ListView paginator in a Pjax widget?" impossible. How do you want it to work?

M
Maxim Fedorov, 2016-04-09
@qonand

you can wrap it by inheriting LinkPager and overriding the render function, but why wrap only the pager in a jacket is not entirely clear...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question