"No results found" message on CGridView

Is it possible to alter the position of the "No results found" message? At the moment it just gets displayed at the bottom of the grid, and the default "displaying n results" message at the top of the grid disappears, shifting the grid upwards.

Ideally I would like the "No results found" message to appear in the same place that the "displaying n results" message is displayed (so that the grid does not shift upwards).

Anyone able to advise? Thanks!

You will need to override the CGridView and override the corresponding method to do that.

You’re wrong.

Just pass the ‘emptyText’ and ‘summaryText’ options:




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

	'id'=>'grid-id',

	'dataProvider'=>$model->search(),

	'columns'=>array(

		...

	),

	'emptyText' => 'Ops, nothing to show!',

	'summaryText' => 'Mostrando {start}-{end} de {count} registro(s).',

));

I believe what GStar want is to have a different place instead of different message…

So it must be inherit the CGridView I think…

Btw, this thread is kinda old already isn’t it?