Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Bob Hendren on Jan 19, 2010 18:33
open dhtmlx forum
Tabbar Height After Ajax

I've seen several questions related to this, but haven't seen a clear solution. I'll describe my particular situation.

I've got two tabs - one with a set size that's initially visible as a photo gallery. On clicking one of the photos, an Ajax fetch is done and the second tab is activated to show the Ajax content. This Ajax content can vary in length and I want the active tab to adjust to it.

Here's the funny part: I've got enableAutoSize(true,true) in my settings, but when the Ajax tab is activated, it's cut short. But if I go back to the static tab and click on the photo AGAIN, Ajax tab shows the adjusted proper height!

I've tried the onTabContentLoaded trick that's mentioned also, but it still gives the same behavior. I've tried timeouts and other stuff - nothing seems to work for me. It just seems odd that it's getting the proper height, but just at the wrong time on the second click.

Any clues?
Answer posted by Alex (support) on Jan 20, 2010 02:10

You can try to call the following method after content reloading:

tabbar.cells(tabId).autoSize();

Answer posted by Bob Hendren on Jan 20, 2010 02:49
Well, I tried that, but may not have done it just right.  Do I make a direct Javascript call to that, or should I put it in an onTabContentLoaded event?  When I tried the direct call, I got an error that autoSize is not a function.
Answer posted by Bob Hendren on Jan 20, 2010 03:20
One other question - I did have only the common and tabbar JS files included for reference.  Do I also need to include the container JS in the header?
Answer posted by Bob Hendren on Jan 20, 2010 03:42
I do actually now have the following includes in my header:

<link rel="stylesheet" type="text/css" href="http://lwcommon.listingware.com/dhtmlxtabbar/codebase/dhtmlxtabbar.css" />
<script type="text/javascript" src="http://lwcommon.listingware.com/dhtmlxtabbar/codebase/dhtmlxcommon.js"></script>
<script type="text/javascript" src="http://lwcommon.listingware.com/dhtmlxtabbar/codebase/dhtmlxtabbar.js"></script>
<script type="text/javascript" src="http://lwcommon.listingware.com/dhtmlxtabbar/codebase/dhtmlxcontainer.js"></script>

One thought - should I not be including these from the remote server?  Should I make them local references on the same server?  Would that hurt/help anything?

Answer posted by Bob Hendren on Jan 20, 2010 03:48
By the way, I'm asking about where to include the files from because the autoSize is still not working.  I only just included the container JS because I found a reference to it in your Common Errors section.  However, you tabbar examples don't show any references to it.  They just have the common and tabbar scripts included.
Answer posted by Alex (support) on Jan 20, 2010 03:57

the answer with the latest dhtmlxtabbar.js will be sent by email.

Answer posted by Bob Hendren on Jan 20, 2010 04:44
Wow!  Thanks for your great responsiveness!  If possible, could you also post the fix here?  I've got some pretty strict anti-spam settings on email and want to make sure I get it.  Thanks.
Answer posted by Bob Hendren on Jan 20, 2010 07:45
BINGO!!!!  WE HAVE A WINNER!

The code I was sent directly did fix the autoSize issue for the Ajax content.  Do you have some way of me paying you for the support or should I just buy your software?  :)
Answer posted by Alex (support) on Jan 20, 2010 09:11

If you need the licence, you can buy it.

But there is no necessity to pay for the provided support :)