Change text 'Displaying X-X of X result(s)

Hello …

I would first like to congratulate all the creators of the framework.

I have a question: Already searched the forum but found no answer.

I would change the text of which shows the CGridView number records:

‘Displaying 1-1 of 1 result (s)’

Can anyone help me?

Sorry, wrong sub-forum.

Can you explain how would you like to change it?

Anyway the summary is rendered by the renderSummary() method - http://www.yiiframework.com/doc/api/1.1/CBaseListView#renderSummary-detail

NOTE: You can check the source of the method there…

No problem - moved to "general discussion for Yii 1.1.x"

Hello mdomba.

I’m Brazilian, and some days I’m looking for a framework to use in my projects.

Yii is really surprising me with so many features and ease of maintenance.

With the help of your response, I saw that there is an attribute called "summaryText". Only I configured it and it solved my problem.

Thank you.

Congratulations again.

Glad you solved it…

And welcome to the world of Yii :)

Hi.

I found, how to change text via


'summaryText' => '...'

but what if I want to disable any summary text? I can fill summaryText with empty string but I still can see empty


<div class="summary"></div>

in output html. Is there a method to remove this div? Thanks.

Edit: My current code is


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

	'dataProvider' => $dataProvider,

	'itemView' => '_view',

	'enablePagination' => false,

	'summaryText' => '',

)); ?>

Define a template property value not containing {summary}.

/Tommy

Thanks, it works!

One more question about CBaseListView. I can see hidden div with keys. It renders in renderKeys(), call of this function is in run(). As I see in sources, I can’t remove this div. So I have a question: what is this keys div for?

Did you ever figure out how to ‘turn off’ the renderKeys? I, too, don’t want it to be rendering a hidden div

The keys DIV is needed by the jQuery script behind CDetailView and CGridView… it holds primary keys for the displayed data…