Yii Framework Forum: Clistview Pagination And Sort Problem - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Clistview Pagination And Sort Problem Pagination and sort only works on localhost Rate Topic: -----

#1 User is offline   Led 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 201
  • Joined: 16-January 12

Posted 04 December 2012 - 06:12 AM

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
0

#2 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,327
  • Joined: 21-February 11
  • Location:Greece

Posted 04 December 2012 - 06:26 AM

Hi

try with that 'ajaxUpdate'=>true,

Also check with firebug if ajax run correctly
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#3 User is offline   Led 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 201
  • Joined: 16-January 12

Posted 04 December 2012 - 06:42 AM

View PostKonApaz, on 04 December 2012 - 06:26 AM, said:

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....tipo?ajax=Casas

don't work

http://localhost/ind...tipo?ajax=Casas

work
0

#4 User is offline   mrk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 33
  • Joined: 07-March 11

Posted 04 December 2012 - 03:47 PM

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',

0

#5 User is offline   Led 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 201
  • Joined: 16-January 12

Posted 05 December 2012 - 06:37 AM

View Postmrk, on 04 December 2012 - 03:47 PM, said:

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.
0

#6 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,083
  • Joined: 16-February 11
  • Location:Japan

Posted 05 December 2012 - 09:36 AM

View PostLed, on 05 December 2012 - 06:37 AM, said:

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. :)
0

#7 User is offline   mrk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 33
  • Joined: 07-March 11

Posted 05 December 2012 - 11:32 AM

Another thing is that your urls differs accross those requests:

request after clicking GO have url like this

http://casasdapraia....Blocalidade%5D=

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

http://casasdapraia....5D//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.
0

#8 User is offline   Led 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 201
  • Joined: 16-January 12

Posted 08 December 2012 - 10:24 AM

View Postmrk, on 05 December 2012 - 11:32 AM, said:

Another thing is that your urls differs accross those requests:

request after clicking GO have url like this

http://casasdapraia....Blocalidade%5D=

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

http://casasdapraia....5D//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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users