views:

29

answers:

1

I'm trying to make my layout update the width of another element, but I need to get at its width NOT including its scrollbar (if one is indeed present). getMainContentBounds() in this case seems to be returning the entire width along with the scrollbar.

I have also tried getSizes() with the same result.

myDataTable.on('postRenderEvent', function() {
    var bounds = YAHOO.specify.app.layout.getMainContentBounds();
    Dom.setStyle(YAHOO.util.Selector.query('div.yui-dt-hd', c.body), 'width', bounds.width+'px');
    Dom.setStyle(YAHOO.util.Selector.query('div.yui-dt-bd', c.body), 'width', bounds.width+'px');
});
+1  A: 

Why don't you place your a marker "element" inside the scrollable.

<div style="width: 200px; overflow: auto;">
    <div id="the-div-width">
        Your content.
    </div>
</div>

Then just focus on getting the width on the-div-width's actual width...

DarkWingCoder
you're right, i should have been doing it this way all along!
DustMason