[ 4 posts ]

Ping Chen

  • Username: cpedia
  • Joined: Thu Aug 13, 2009 2:14 am
  • Posts: 14
  • Offline
  • Profile

How to resize the height of ScrollingDataTable dynamically?

Post Posted: Thu Aug 18, 2011 3:05 am
+-1-
How to resize the height of ScrollingDataTable dynamically?

I use layout manager to construct the page, the ScrollingDataTable is in the main area.

When I resize the window, I need the ScrollingDataTable also resize the height automatically.

How to achieve that?

Thanks in advance.

Ping Chen

  • Username: cpedia
  • Joined: Thu Aug 13, 2009 2:14 am
  • Posts: 14
  • Offline
  • Profile

Re: How to resize the height of ScrollingDataTable dynamical

Post Posted: Thu Aug 18, 2011 3:11 am
+0-
I tried

Dom.setStyle(myDataTable, 'height', (Dom.getClientHeight() - 65 - 100) + 'px');

But no success.

Todd Smith

YUI Contributor

  • Username: stlsmiths
  • Joined: Thu Nov 05, 2009 10:03 am
  • Posts: 675
  • GitHub: stlsmiths
  • Gists: stlsmiths
  • IRC: t_smith
  • Offline
  • Profile

Re: How to resize the height of ScrollingDataTable dynamical

Post Posted: Thu Aug 18, 2011 5:59 am
+0-
You really can't resize the SDT by changing styles. The only way I can think of is to destroy/regenerate the SDT after the panel resize.

Somebody else just asked about this at http://new.yuilibrary.com/forum/viewtopic.php?f=90&t=8402.

Ping Chen

  • Username: cpedia
  • Joined: Thu Aug 13, 2009 2:14 am
  • Posts: 14
  • Offline
  • Profile

Re: How to resize the height of ScrollingDataTable dynamical

Post Posted: Thu Aug 18, 2011 6:51 am
+0-
Thanks, Todd.

Just found the way to do that.

As dataTable is a YAHOO.util.Element object, so I just call the set() method inherited from Element to setup the config property.

myDataTable.set("height", "100px");
  [ 4 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum