CGridView column sort: blanks screen

I’m creating a module with an action which displays a view with a CGridView.

This part goes fine.

When I click on a column header to sort by that column it blanks the gridView.

I can’t figure out what’s happening.

View:




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

	'dataProvider'=>$collection,

	'columns'=>array(

		'username',

		'email',

		'status',

		array(

			'class'=>'CButtonColumn',

		),

	),

)); ?>



Action:




public function actionList()

{

	$users=new WUserModel();

	if(isset($_GET['WUserModel']))

		$users->attributes=$_POST['WUserModel'];


	$criteria=new CDbCriteria;

	$criteria->compare('deletedOn',null);

	$collection=new CActiveDataProvider('WUserModel',array(

		'criteria'=>$criteria,

		'sort'=>array(

			'defaultOrder'=>'username',

		),

		'pagination'=>array(

			'pageSize'=>20,

		),

	));


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

		'users'=>$users,

		'collection'=>$collection

	));

}



The problem only happens when I have javascript enabled.

If I disable it in my browser, everything works fine.

Any clue?

Please, can anyone give me a hint of what to look for?

I have absolutely no idea where to start or what to look for.

Maybe you should do what I do.

public function actionIndex() {

    &#036;model=new User('search');


&#036;model-&gt;unsetAttributes();


if(isset(&#036;_GET['User']))


        &#036;model-&gt;attributes=&#036;_GET['User'];


&#036;this-&gt;render('index',array(


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


));


}

$this->widget(‘GridView’, array(

'id'=&gt;'User-grid',


'dataProvider'=&gt;&#036;model-&gt;search(),


'selectableRows' =&gt; 100,





'filter'=&gt;&#036;model,


'columns'=&gt;array(


            'user_name',


            'gender',

)));

NOTICE: Mandy, please use code tag (second button to the right), when pasting code examples, so it will be more readable by others.

If you disable JavaScript then filtering/searching/sorting/pagination goes through normal request and that is why it is working.

If you have a problems like you described then I would rather start looking for your browsers configuration. I’m not sure but it seems that something is blocking your AJAX (JS) requests. Have you tried to run your website under other browser or even better - from another computer? Have you tried if sorting works in a freshly generated application to make yourself sure that error isn’t in your own code?