I described my problem in another issue (http://drupal.org/node/1221298#comment-5375450) but it looks like it hasn't really anything to do with the problem there. So I'm oping this one, because I can't find an existing issue describing my problem (I'm not sure if it is related to http://drupal.org/node/1063932).

I have a quick tabs view and a view in one tab. The second view has two pages (and will have more in the future) and uses ajax. If I switch the page of the view, it doesn't only jump to the chosen page but it also changes the first view to the default tab. I would understand why this is happening if the view of which I change the page wouldn't use ajax. But it does (I can see the blue clock icon and the page doesn't reload). It just loads the second page of the view, scrolls to the beginning and switches the tabs view to the first tab.

I created a second view with a different pager ID to see if there is any difference, but it does just the same.

Did I do something wrong or am I missing soething? It looks like a bug to me.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

steeph’s picture

Could maybe someone with JS experience give me a hint where I could start to look in the code?

steeph’s picture

OK, I'm not a coder, but from what I found out, the problem is that when the views page is switched, the class "active" gets removed from the QT tab. So when Drupal.quicktabs.prepare is called, the first tab is shown because no active tab is found.

Now I set a variable at the first line of quicktabs.js and give it a different value at the end of Drupal.quicktabs.prepare. When the function gets called the next time (withput reloading the entire page), I let QT switch to the second tab (li.qtab-1) (that is the tab that contains the view with the pager) instead of the active tab (li.active).

This works for my site for now, but, as you see, I'm a bit lost on what to do to fix this properly.

Chris Pergantis’s picture

Version: 6.x-3.0 » 7.x-3.6

Just installed the project and am having the same issue.

I have tried it both with the default tab set and with the default tab set to none. In either case the "pager" when clicked removes any reference to the currently active tab and returns it to the first visited state. This prevents any use beyond the first page on any tab...

I would like to say this module is a great idea and I am sure has wonderful application to show limited information in a simple side block. Not so sure I would expect it to provide any large amount of information due to this error. If any one is watching this thread please let me know. Perhaps we can work together on resolving this issue.

Steeph ? could you post the changes you made so that we can get an idea of what made this change work for you?? This could be a great start to resolving this issue.

Chris Pergantis’s picture

I just revisited the site to try a few other setting changes within QuickTabs.

I turned off the Ajax setting (from yes to no). Prior to this the Ajax setting was 'yes'.

This resulted in the pager working a bit better. Now the pager is advanced properly on the selected tab, however the tab does not remain selected. The active tab after the page select resolves is the default tab determined in the settings for default. When i click on the tab that was selected prior to the pager the page was moved to the one that had been selected.

I will now try to set the default tab to none and retry the same test. BRB

OK this configuration causes none of the tabs to be selected yet still maintains the correct page for each tab.

Right now ajax being set to yes is a no go for our required setup. This not a problem. Looks like our greatest issue is having the currently selected tab to be the selected tab after a pager event.

steeph’s picture

My workaround was a dirty one that works only for that site. If your setup is similar, it might work for you site, too. I'm not maintaining the site where I used Quicktabs anymore. But I was able to get a copy of the module with my changes. See the attached patch. It's for 6.x-3.0. If you have questions about it, you can ask, but I'm not sure if I can answer them. It's been some time that I used that module. Hope it helps.

Chris Pergantis’s picture

Thanks for the quick response and your time to locate this patch. Perhaps our team can manage to restructure your patch into something of more permanent fix to the module.

mandar37’s picture

Work for me for 7.X
Thanks steeph #5

kenorb’s picture

Status: Active » Needs review

The last submitted patch, 5: quicktabs_dirty_workaround.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 7: qt_work_for_me.patch, failed testing.