How Can You Lazy Load This?

I can do it from the model but I am having problems doing it in the view with the code below.







        <?php

        $dataProvider = new CActiveDataProvider('Addon', array(

                'criteria' => array(

                    'limit'=>30,

                    'order'=>'create_date DESC',

                    'condition' => 'status=1',

                ),

                'pagination'=>false

        ));        

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

                'dataProvider'=>$dataProvider,

                'itemView'=>'_view',

                'id'=>'downloadsListView',

                'pager'=> array(

                        'header' => '',

                        'footer' => '',

                        'firstPageLabel' => 'First Page',

                        'prevPageLabel'  => 'Prev. Page',

                        'nextPageLabel'  => 'Next Page',

                        'lastPageLabel'  => 'Last Page',

                ),

                'template'=>'{sorter}{items}{pager}',

                'emptyText'=>'There are no Marketplace items at this time',

        )); ?>



That returns exactly what I need however it just query’s 30 times for this (the limit i have set to return or else it would do more or less depending on the limit) which doesn’t work.

Any help would be greatly appreciated.

Thank you

edit got it working


<?php

        $criteria = new CDbCriteria();

        $criteria->together = TRUE;

        $criteria->with = 'creator0';

        $criteria->condition = 't.status = 1';

        $criteria->limit=30;

        

        $dataProvider = new CActiveDataProvider(Addon::model(), array('criteria'=>$criteria, 'pagination'=>false));

        

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

                'dataProvider'=>$dataProvider,

                'itemView'=>'_view',

                'id'=>'downloadsListView',

                'pager'=> array(

                        'header' => '',

                        'footer' => '',

                        'firstPageLabel' => 'First Page',

                        'prevPageLabel'  => 'Prev. Page',

                        'nextPageLabel'  => 'Next Page',

                        'lastPageLabel'  => 'Last Page',

                ),

                'template'=>'{sorter}{items}{pager}',

                'emptyText'=>'There are no Marketplace items at this time',

        )); ?>