Clistview Pagination And Sort Problem

I have strange problem with ClistView widget.

it is working at localhost. I’m using GET to avoid resend data by user when click back button.

The problem is that this dont work when upload to server.

What could be the problem?


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

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

        'itemView'=>'_view',

        'id'=>'#Casas',

        'ajaxUrl'=>array($this->getRoute()),

        'sortableAttributes'=>array('cod_casa','tipo','pessoas','destino'),


));



No errors , just empty results , what is not true

Hi

try with that ‘ajaxUpdate’=>true,

Also check with firebug if ajax run correctly

ajx run correctly. but no results after paginate or sort.

Strange.

http://casasdapraia.pt/index.php/casa/search/Casa[tipoalojamento]//Casa[tipo]//Casa[for_sale]/1/Casa[localidade]//Casa_sort/tipo?ajax=Casas

don’t work

http://localhost/index.php/casa/search/Casa[tipoalojamento]//Casa[tipo]//Casa[for_sale]/1/Casa[localidade]//Casa_sort/tipo?ajax=Casas

work

I’m not sure why this would make a problem on production server and to work on localhost but try changing this


'id'=>'#Casas',

into


'id'=>'Casas',

nothing to do with this.

Did you try mrk’s suggestion?

I think the ‘id’ property should not include ‘#’.

In many cases the cause is just a character casing issue when your app runs well on local machine and not on the remote server. Don’t you have any idea on that?

And try setting ‘ajaxUpdate’ to false. It is easier to debug with ‘ajaxUpdate’ set to false. :)

Another thing is that your urls differs accross those requests:

request after clicking GO have url like this

http://casasdapraia.pt/index.php/casa/search?Casa[tipoalojamento]=&Casa[tipo]=&Casa[for_sale]=1&Casa[localidade]=

in requests after navigating using grid’s button your url looks like this:

http://casasdapraia.pt/index.php/casa/search/Casa[tipoalojamento]//Casa[tipo]//Casa[for_sale]/1/Casa[localidade]//Casa_page/2

Difference ? Slashes instead of ‘=’ in specification of GET params. What is more slashes are ‘escaped’ = '//. I guess they looks like this after JSONing this part of url.

Don’t look on the problem like this is OK because it works on localhost. Localhost env has usually totally different config of apache so some fancy pieces of code can work.

I guess it can be apache/.htaccess problem. On your localhost it accepts both ‘param=value’ and ‘param/value’ ways of passing params. While your production apache is configured the way it doesn’t handle params passed the second way.

Either comment urlFormat => ‘path’ in your config or research how your application in production is handling params in PATH format.

Sounds good