Is it possible to render CGridView pager separately. For example, there is special placeholder on webpage for pagers defined in layout and it is required to display pager only there for every view that uses this layout.
Thanks.
Page 1 of 1
Render Cgridview Pager Separately
#2
Posted 12 October 2012 - 07:42 PM
it is possible:
in layout first define the placeHolder :
now you should pass the pager clip to the layout file (some other action/view will ignore the pager clip ):
you'd better to see the CClipWidget class . and think about why i use clip to pass html section to layout file
in layout first define the placeHolder :
// someLayout :
if(isset($this->clips['pager'])){
echo $this->clips['pager'];
}
now you should pass the pager clip to the layout file (some other action/view will ignore the pager clip ):
// let 's say it is your admin.php :
$gridView = $this->widget('zii.widgets.grid.CGridView',array('templage'=>'{items}{summary}'..));
// few people know $this->widget return a widget obj and seldom use that object
// now you should pass the pager to the layout file:
$this->beginClip('pager');
$gridView->renderPager();
$this->endClip();
you'd better to see the CClipWidget class . and think about why i use clip to pass html section to layout file
#4
Posted 13 October 2012 - 02:46 AM
yiqing95, on 12 October 2012 - 07:42 PM, said:
it is possible:
in layout first define the placeHolder :
now you should pass the pager clip to the layout file (some other action/view will ignore the pager clip ):
you'd better to see the CClipWidget class . and think about why i use clip to pass html section to layout file
in layout first define the placeHolder :
// someLayout :
if(isset($this->clips['pager'])){
echo $this->clips['pager'];
}
now you should pass the pager clip to the layout file (some other action/view will ignore the pager clip ):
// let 's say it is your admin.php :
$gridView = $this->widget('zii.widgets.grid.CGridView',array('templage'=>'{items}{summary}'..));
// few people know $this->widget return a widget obj and seldom use that object
// now you should pass the pager to the layout file:
$this->beginClip('pager');
$gridView->renderPager();
$this->endClip();
you'd better to see the CClipWidget class . and think about why i use clip to pass html section to layout file
Thank you so much! It is really that behaviour I've searched for.
Share this topic:
Page 1 of 1

Help












