Ajax pagination in ListView

Hi, explain please, how enable ajax pagination in widget ListView. I have tried to do so:




use yii\widgets\ListView;

use yii\widgets\Pjax;


Pjax::begin(); //['timeout'=>700] ['enablePushState'=>false] 


echo ListView::widget([ 

        'id' => 'sdfsd',

        'dataProvider' => $dataProvider,

        'itemView' => '_news',

        'layout' => '

            <div class="cat_title_block">News{pager}</div>

            <div>

                {items}

                <div class="clr"></div>

            </div>

        ',

        'pager' => [

            'maxButtonCount' => 5,

            'prevPageLabel' => '<',

            'nextPageLabel' => '>',

            'firstPageLabel' => '<<',

            'lastPageLabel' => '>>',

        ],

    ]);

Pjax::end();



but it’s not work.

The following link will definitely help you:

http://www.yiiframework.com/doc-2.0/yii-data-pagination.html

$maxButtonCount: Maximum number of page buttons that can be displayed. Defaults to 10.

It is not for no. of records to be displayed.

You need to set $pagination.