Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] how to implement pagination with ActiveDataProvider #32

Open
hunglsxx opened this issue Feb 3, 2020 · 0 comments
Open

[Question] how to implement pagination with ActiveDataProvider #32

hunglsxx opened this issue Feb 3, 2020 · 0 comments

Comments

@hunglsxx
Copy link

hunglsxx commented Feb 3, 2020

Hi,
First, many thanks for sharing a very useful extension.
Please, Let me know how to implement pagination with ActiveDataProvider. I tried it after reading your test code, but things didn't seem to be as expected.
This is my code
// search function in search model
public function search($params) {
     $query = Model::find();
     $dataProvider = new ActiveDataProvider([
          'query' => $query,
          'pagination' => [ 'pageSize' => 5, ],
     ]);
     return $dataProvider;
}

// view
<?=GridView::widget([
     'dataProvider' => $dataProvider,
     'filterModel' => $searchModel,
    'columns' => [
        ['class' => 'yii\grid\SerialColumn'],
        'some_attr',
        '...'
    ]
]);=>
I want to show operator button (next button or preview button) but nothing show.
Please give me some instructions.
Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant