Yii Framework Forum: [Solved] problem with different paginations in the same tabview. - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

[Solved] problem with different paginations in the same tabview. Rate Topic: -----

#1 User is offline   balha 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 08-January 09

Posted 10 June 2009 - 12:26 PM

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

#2 User is offline   balha 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 08-January 09

Posted 13 June 2009 - 07:41 AM

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';       
}

0

#3 User is offline   mariodig 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 05-February 10

Posted 28 August 2010 - 09:41 AM

Thanx, this works perfectly.
0

#4 User is offline   tanimgt 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 52
  • Joined: 07-April 11
  • Location:Bangladesh

Posted 08 May 2011 - 01:57 AM

View Postbalha, on 13 June 2009 - 07:41 AM, said:

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

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