balha
(Balha)
June 10, 2009, 5:26pm
1
Hi,
I have different paginations in the same tabview, each one has his own tab page.
and the probleme is when I try to navigate in one pagination bar, the web page is always reloaded with the pagination layed in the default tab.
I didn’t find any way to pass the ‘activeTab’ property as a parameter in the url created by the pagination bar.
Is there anything I'm missing?
Thanks for your help,
Balha,
balha
(Balha)
June 13, 2009, 12:41pm
2
and here is the solution in two steps :
1- I have overrided the createPageUrl() method so that a $_GET parameter is created and initialized with the active pager.
<?php
class MyPagination extends CPagination
{
public function createPageUrl($controller,$page)
{
$_GET['currentPager'] = $this->pageVar;
return(parent::createPageUrl($controller,$page));
}
}
2- in the controller I make a test on the content of the $_GET['currentPager'] like the following :
<?php
if($_GET['currentPager']=='first_pager')
{
$tabpages->activeTab = 'first_tab';
}
elseif($_GET['currentPager']=='second_pager')
{
$tabpages->activeTab = 'second_tab';
}
mariodig
(Vidaest)
August 28, 2010, 2:41pm
3
Thanx, this works perfectly.
tanimgt
(Tanimgt)
May 8, 2011, 6:57am
4
balha:
and here is the solution in two steps :
1- I have overrided the createPageUrl() method so that a $_GET parameter is created and initialized with the active pager.
<pre class=‘prettyprint’>
<?php
class MyPagination extends CPagination
{
public function createPageUrl($controller,$page)
{
$_GET['currentPager'] = $this->pageVar;
return(parent::createPageUrl($controller,$page));
}
}
</pre>
2- in the controller I make a test on the content of the $_GET[‘currentPager’] like the following :
<pre class=‘prettyprint’>
<?php
if($_GET[‘currentPager’]==‘first_pager’)
{
$tabpages->activeTab = ‘first_tab’;
}
elseif($_GET[‘currentPager’]==‘second_pager’)
{
$tabpages->activeTab = ‘second_tab’;
}
</pre>
Brothers, i cannt understand you solution, i am very new in yii and got the same problem. can you please help me a little more? where you put the above files ? and how they called ?
tanaks , <tanim>