Yii Framework Forum: Extension Inifinite-Scroll-Pager - Yii Framework Forum

Jump to content

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

Extension Inifinite-Scroll-Pager Not showing the next pages Rate Topic: -----

#1 User is offline   Maclein 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 25-April 12

Posted 31 October 2012 - 04:43 AM

Not showing the next pages

When I scroll the page, its showing only the page 1, its not showing the next 2nd or 3rd pages. But in address bar the page no is changing to 2 and 3. The pagination is not showing. Please help.
1

#2 User is offline   klammeraffe 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 07-September 12
  • Location:Berlin, Germany

Posted 05 January 2013 - 01:43 PM

Same here. I will try to show better what I have.

In the controller:
public function actionIndex()
	{

	$count=Yii::app()->db->createCommand("SELECT count(*) from posts where authorid = 1")->queryScalar();
	$sql="SELECT * FROM posts WHERE authorid = 1";
	
	$dataProvider= new CSqlDataProvider($sql, array(
	    'totalItemCount'=>$count,
	    'id'=>'dashstream',
	    'keyField' => 'postid',
	    'sort'=>array(
    		'defaultOrder'=>array(
    			'dateread'=>SORT_DESC,
			),
	    ),
	    'pagination'=>array(
	        'pageSize'=>20,
	    ),
	));
	$this->render('view',array(
		'dashstream'=>$dataProvider,
	));
	}

(with simplefied sql)
and in the view file

<?php 
$this->widget('zii.widgets.CListView', array(
    'id' => 'dashstream',
    'dataProvider'=>$dashstream,
    'itemView'=>'_dashstream',
    'template'=>'{items} {pager}',
   	'pager' => array(
                'class' => 'ext.infiniteScroll.IasPager', 
                'rowSelector'=>'.row', 
                'listViewId' => 'dashstream', 
                'header' => ''
              ),
	)
);
?>


If I remove the pager part, 'manual' pagination works just fine. With the pager part, the url in the browser URI bar is changing to the higher pages, communication with the server can be seen (read [05/Jan/2013:19:37:22 +0100] "GET /dashboard/index?dashstream_page=5 HTTP/1.1" 200 2955 "http://domain.com/dashboard" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/11.10 Chromium/18.0.1025.168 Chrome/18.0.1025.168 Safari/535.19") but new lines do not appear.

Help is very much appreciated!
1

#3 User is offline   EdmYiiUser 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 21-October 11

Posted 22 February 2013 - 02:57 PM

Maybe it's a bit late but I had the same problem and solved it by changing the
'rowSelector' => '.row',
parameter. ".row" must be the name of the class of the html tag that you're using to wrap the _dashstream.php itemView's contents. This and making the browser's window smaller / paging bigger to trigger the code did the trick
0

#4 User is offline   EugeneRus 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 26-April 13

Posted 26 April 2013 - 05:52 PM

Sorry for my English.
I had a similar problem.
The reason is that ias.js can not find the url of the next page:
$ ('#dashstream. next a', data). attr ('href')

This selector does not work if the data contains
<div id='#dashstream'> ... </ div>

"data" - is the contents of the next page
it must be wrapped in an extra div:
<div> <div id='#dashstream'> ... </ div> </ div>

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