I am having trouble getting all rows to display in each page. The total number of rows is 308, and pageSize is set to 100, but each of the 4 pages show a subset of 100 records, varying in each set, never more than 16 rows, sometimes as few as 1 per page. Did I forget to enable something or set a parameter?
In the view:
<?php
class AuthorizationGridView extends CGridView {
public $YearSel;
}
// ...
$this->widget('AuthorizationGridView', array(
'id'=>'auth-grid',
'dataProvider'=>$model->authsearch($Year),
'YearSel' => $Year,
'filter'=>$model,
"htmlOptions" => array(
'style'=>'width: 1100px;'
),
'columns'=>array(
...
)));
// In the model:
public function authsearch($yr)
{
// MAIN QUERY CONDITION
$criteria=new CDbCriteria;
$criteria->addCondition('t.MRPLid IS NOT NULL');
// ...
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
'pagination' => array(
'pageSize' => 100,
),
'sort'=>array(
'defaultOrder'=>'Request_id DESC',
'multiSort'=>true,
'attributes'=>$attrAry,
),
));
}
I wouldn’t normally want pagination for 300 rows, but I resorted to it after experiencing a memory fault with memory_limit set to 500M and then again at 600M, which seems to be an excessive amount of memory needed for 300 rows. 900M resolved the memory fault, but I thought I’d try pagination to avoid having to set an arbitrary memory_limit that still might cause a fault in the future. The table I’m displaying has about 20 columns, some columns contain attributes in the model, some columns follow foreign keys to an attribute in a definition table, some columns are computed by functions in the model.
So, I don’t know why the display is utilizing such an excessive amount of memory to begin with, and also why pagination is not working properly.
Edit: code formatting added