I’m having a strange problem with gridView and pagination. This is my search function
public function search($params = [])
{
$query = StandardTaskTemplate::find()
->select('*')
->join('LEFT JOIN', TaskTemplateTask::tableName(), TaskTemplateTask::tableName().'.standard_task_id = t_template_tasks_old_system.taskid')
->join('LEFT JOIN',TaskTemplate::tableName(), TaskTemplate::tableName().'.id = t_task_template_task.task_template_id')
->join('LEFT JOIN', SourcesTask::tableName(), SourcesTask::tableName().'.task_id = t_template_tasks_old_system.taskid')
//->where(['task_template_id' => $params['task_template_id']])
->orderBy('tasktext')
$provider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
$query->andFilterWhere(['=', 'task_template_id', $this->task_template_id]);
$query->andFilterWhere(['like', 'tasktext', $this->tasktext]);
$query->andFilterWhere([ '=','categoryid', $this->categoryid]);
$query->andFilterWhere(['=', 'state', $this->state]);
$query->andFilterWhere(['=', 'repeating_type', $this->repeating_type]);
return $provider;
}
this is my contoller
$searchModel = new StandardTaskTemplateSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$dataProvider->setPagination(['pageSize' => '20'])
return $this->render('templates', ['dataProvider' => $dataProvider,
'searchModel' => $searchModel]);
}
but on the view, the first page shows
Showing 1-14 of 1,224 items.
and the second page shows
Showing 21-40 of 1,224 items.
and I can’t see rows 15 to 20 at all? I can’t figure out why this is happening? any ideas