Yii - Tbgridview Issue Sorting And Filtering


I’m having a strange situation that is happening only with one of my views. I’m developing a small Yii application for my employee and I’ve already managed to create several different TbGridViews for different areas of the applications (Products / Services), all using somewhat the same structure. The issue here is happening only on a specific grid (Companies), where sorting, filtering and paging are not working. Everytime I try to sort, filter or change page, nothing happens (the grid shows the same information). Yet, if I delete a item, the grid refreshes correctly, as it should. I’ve searched the forums and saw several advices so far for this (criteria -> order, for instance, was one of the things that caused this issue, or ajaxRefresh -> disable) but, so far, none of these solutions work, since I don’t have bug that originated them in my code (or at least I cannot find it). I’ve compared the models / controllers and views between the grids that work and the grids that don’t work and they seem pretty much the same to me, so it should be working. So I was wondering if someone could shed some light into this. Below you can find the code:

View Code

<?php $this->widget('bootstrap.widgets.TbGridView',array(


	'type'=>'bordered condensed',




		 array('name'=>'cid', 'header'=>'#'),

		 array('name'=>'name', 'header'=>'Name'),

		 array('name'=>'fiscalnumber', 'header'=>'Fiscal Nr.'),

		 array('name'=>'vat', 'header'=>'VAT'),

		 array('name'=>'year', 'header'=>'Year'),

		 array('name' => 'companycategoryid',

		 	   'filter' => CHtml::listData(Companycategory::model()->findAll(), 'cgid', 'category'),

               'value' => 'Helper::getCompanyCategory($data->companycategoryid)',

               'header'	=> 'Category'),

		 array('name'=>'importexportstatus', 'header'=>'Exports?'),











)); ?>

Controller Code (that calls the view)

public function actionIndex()


		$model=new Company('search');	









Model Code (search function)

public function search()


		// @todo Please modify the following code to remove attributes that should not be searched.

		$criteria=new CDbCriteria;        






























		return new CActiveDataProvider($this, array(




Any help with this would be welcome.

Thanks :)


Anyone out there has any ideas?

Thanks :)

Is the data contains any special characters?


Sorry for replying so late. Yes, it has some special characters (Portuguese language). Do you think that might be it? I’ll give it a try.

Thanks :)

Well solved it. It was, after all, a bug in an additional function that I created that was overriding a default function (findAll())