Loading ...
Sorry, an error occurred while loading the content.

Re: test for LayoutUnit scrollbars visibility

Expand Messages
  • Mark Veerman
    That worked perfectly. Thanks, Mark ... compare the elements scrollHeight to it s offsetHeight. ... are there is a scrollbar showing (if the element has
    Message 1 of 3 , Aug 26, 2008
    • 0 Attachment
      That worked perfectly.

      Thanks,
      Mark

      --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
      >
      > Mark --
      >
      > It see if an element has scrollbars visible, you should be able to
      compare the elements scrollHeight to it's offsetHeight.
      >
      > If the scrollHeight is larger than the offsetHeight, then chances
      are there is a scrollbar showing (if the element has overflow: auto
      set to make them show up).
      >
      > You can get to the Unit's body like this:
      >
      > var body = layout.getUnitByPosition('center').body;
      > body.offsetHeight;
      > body.scrollHeight;
      >
      > Does that help?
      > Dav
      >
      > Dav Glass
      > dav.glass@...
      > blog.davglass.com
      >
      >
      >
      >
      > + Windows: n. - The most successful computer virus, ever. +
      > + A computer without a Microsoft operating system is like a dog
      > without bricks tied to its head +
      > + A Microsoft Certified Systems Engineer is to computing what a
      > McDonalds Certified Food Specialist is to fine cuisine +
      >
      >
      >
      > ----- Original Message ----
      > > From: Mark Veerman <mark@...>
      > > To: ydn-javascript@yahoogroups.com
      > > Sent: Tuesday, August 26, 2008 10:16:44 AM
      > > Subject: [ydn-javascript] test for LayoutUnit scrollbars visibility
      > >
      > > Hello,
      > >
      > > I have a LayoutUnit with scroll: true. I'm dynamically sizing the
      > > columns of a nested DataTable to the width of that LayoutUnit. The
      > > issue is that my DataTable sizing function needs to know if the
      > > scrollbars are visible in the LayoutUnit or not, and that's dependent
      > > on the number of rows in the current DataSource.
      > >
      > > Is there an easy way to tell if the scrollbars are visible in a
      > > LayoutUnit?
      > >
      > > Alternatively, should I just subtract the height of the DataTable from
      > > the height of the LayoutUnit to determine if it's scrolling?
      > >
      > > If the latter, what's the best way to get the current DataTable
      height?
      > > layout.getSizes().center.h - ??
      > >
      > > Thanks,
      > > Mark
      > >
      > >
      > > ------------------------------------
      > >
      > > Yahoo! Groups Links
      > >
      > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.