Is It Possible For Cactivedataprovider List All Data?

When using CActiveDataProvider, the number of data to be display is base on the pagesize, is there anyway to display all data?

$dataProvider = new CActiveDataProvider('MyModel', array('pagination' => false));

I assume you’re using either CGridView or CListView, so you can set ‘enablePagination’ to false:

I tried ‘pagination’ => false with error : Trying to get property of non-object

It works for me. Can you post your code (both controller action and view)?

controller :

$user = new CActiveDataProvider('User', array(





            "SUM(c.days) + FLOOR(SUM(c.hours) / 6) as days",

            "SUM(c.hours) % 6 as hrs",


        'join'=>'LEFT JOIN tbl_user_course AS uc ON t.user_id = uc.user_id ' .

                'LEFT JOIN tbl_course AS c ON uc.course_id = c.course_id ',

        'condition'=>'t.dept = :dept AND t.deleted = :deleted ',

        'order'=>'days, hrs, full_name',







    'pagination' => false,


view :

$this->widget('zii.widgets.grid.CGridView', array(










error :

PHP Error

Trying to get property of non-object

C:\xampp\htdocs\yii118\framework\base\CComponent.php(619) : eval()'d code(1)