CListView incorrect summary info

hello guys,

I recently made the big step and started to play with the latest 1.1.1 branch. It’s definitely different than the 1.0.x ;)

So, I’m trying to use the magnificent CListView Zii widget with the following model/controller setup …




// some action

...

        $criteria = new CDbCriteria();

        $criteria->group = 'title';

        $criteria->order = 'created DESC';


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

			'pagination'=>array(

				'pageSize'=>self::PAGE_SIZE,

			),

                        'criteria' => $criteria,

		));


		$this->render('index',array(

			'dataProvider'=>$dataProvider,

		));

...



As you can see, I’m grouping on the TITLE field. It works exactly as expected, except the summary (and pagination part). It seems like the summary (and pagination) shows all the results without my grouping.

I’m most likely missed something (never went to the 1.1.1 school :) )

btw, my view looks like this:




...

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

	'dataProvider'=>$dataProvider,

	'itemView'=>'_view',

)); ?>

...



thanks for the help,

–iM

hello,

Turned on the logging and it’s clearly showing something …




Querying SQL: SELECT COUNT(*) FROM 'pages' 't'

in /var/www/yii-1.1.1.r1907/framework/zii/widgets/CBaseListView.php (99)

in /var/www/yii-1.1.1.r1907/framework/zii/widgets/CListView.php (151)

in /var/www/yiiki/protected/views/page/index.php (17)






Querying SQL: SELECT * FROM 'pages' 't' GROUP BY title ORDER BY created

DESC LIMIT 10

in /var/www/yii-1.1.1.r1907/framework/zii/widgets/CBaseListView.php (99)

in /var/www/yii-1.1.1.r1907/framework/zii/widgets/CListView.php (151)

in /var/www/yiiki/protected/views/page/index.php (17)



so the count is clearly off :confused:

–iM

hello,

So, I tried it many different ways but it’s still not working.

Is there a way I can use the 1.0.x style pagination in 1.1.1?

thanks,

–iM

This is problematic for me too, except I want to use a custom pager style. I have created a custom pager widget which has different CSS classes and IDs, and I would like to use those classes in the pager generated by the CActiveDataProvider instance.

Which reminds me of another problem… it’s annoying that I have to add another URL rule every time I put a pager in a view to handle the new variable… I might have to create a new thread for that.

Yes very annoying… I prefer the old style? How to override the pager? It’s all PHP and no clear way to override give me back my html :(

mech7,

we opened a ticket for this, please click on the STAR on it so the developers will know that it is needed …

http://code.google.com/p/yii/issues/detail?id=1072&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Stars%20Summary

–iM

Ah i see… but I did not see anything about the template for the pager…

As far as i can see in the documentation there is a template:

<?php $this->widget(‘zii.widgets.CListView’, array(

'dataProvider'=&gt;&#036;dataProvider,


'itemView'=&gt;'_view',


    'pager'=&gt; array('cssFile'=&gt;false, 'header' =&gt; false),


    'template' =&gt; '{pager}


                &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;


                {summary}


                {items}


                &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;


                {pager}'

)); ?>

But how ugly is that? the reason i use mvc is to seperate my html from logic… I don’t need / want to add another layer of complexity in my views.

Ah i see… but I did not see anything about the template for the pager…

As far as i can see in the documentation there is a template:

<?php $this->widget(‘zii.widgets.CListView’, array(

'dataProvider'=&gt;&#036;dataProvider,


'itemView'=&gt;'_view',


    'pager'=&gt; array('cssFile'=&gt;false, 'header' =&gt; false),


    'template' =&gt; '{pager}


                &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;


                {summary}


                {items}


                &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;


                {pager}'

)); ?>

But how ugly is that? the reason i use mvc is to seperate my html from logic… I don’t need / want to add another layer of complexity in my views. let alone mixing html in php array’s