hello,
My pagination doesn’t work as he should work.
here my code :
public function search() {
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria = new CDbCriteria;
$criteria->with = array('projetsActif','tachesActif');
$criteria->compare('tachesActif.tache_id', $this->fk_tache, true, 'AND');
$criteria->compare('projetsActif.projet_id', $this->fk_projet, true, 'AND');
$criteria->compare('fk_personne', $this->fk_personne, true, 'AND');
// traitement date
if ($this->date_debut == "") {
$this->date_debut = helpers::getDateMin($this->date_debut);
}
Yii::app()->setGlobalState('dateDebut', $this->date_debut);
if ($this->date_fin == "") {
$this->date_fin = helpers::getDateMax($this->date_fin);
}else{
Yii::app()->setGlobalState('dateFin', $this->date_fin);
}
$criteria->addBetweenCondition('date', helpers::setFormatDateForQges($this->date_debut), helpers::setFormatDateForQges($this->date_fin), 'AND');
;
$criteria->together = true;
// exit();
$sort = new CSort();
$sort->attributes = array(
'defaultOrder' => array('date DESC'),
'date' => array(
'asc' => 'date',
'desc' => 'date desc',
),
'projetsActif' => array(
'asc' => 'acronyme',
'desc' => 'acronyme desc',
),
'tachesActif' => array(
'asc' => 'titre',
'desc' => 'titre desc',
),
'facture' => array(
'asc' => 'facture',
'desc' => 'facture desc',
),
'personnesActif' => array(
'asc' => 'NomPersonne',
'desc' => 'NomPersonne desc',
),
);
$sort->applyOrder($criteria);
return new CActiveDataProvider($this, array(
'criteria' => $criteria,
'sort'=>array(
'defaultOrder'=> 'date DESC',
),
'pagination' => array(
'pageSize' => 200,//Yii::app()->params->nbrElementParPage,
)
));
}
I put ;
‘pageSize’ => 200
but he display only 13 row and when I click to see the second page, I Have :
and the 3rd page :
any ideas?
Thanks
Nath