| Page 1 of 1 | [ 6 posts ] |
|
Hello,
I have a DataTable in a resizable Panel, but I cannot figure out how to resize the table when the panel is resized. |
|
Using your data table object "DT", try:
DT.context.set ('width', ''+w+'px'); DT.context.set ("height", ''+h+'px'); Note that w and h are the desired height and width, respectively. Hope that helps... ~~bret |
|
That doesn't work.
I can actually resize the table with : self.table.setAttributes({width: width + 'px'},true); self.table.setAttributes({height: height + 'px'},true); But that doesn't resize the columns, just some empty space is added to the table. |
|
Suggest you post a pastie link to your code so people can see what you have so far.
|
|
Hello,
I put the relevant portion of the code at http://pastie.org/2380705. It is nearly verbatim stolen from YUI example of Panel resizing. My problem is to make the table in the panel resize together with the panel. I can make the table resize, but not the columns in it. |
|
The pastie code you provided doesn't show any DataTable definitions. We can't offer much help for what we can't see here !
You will probably have to do a lot of programming work to resize a DT in a resizable panel. The Resize utility cannot operate directly on the DT. The only way I can think of that may make this work is to (a) define resizable columns on the DT columndefs and see what comes out, OR (b) specify column definitions for the base Panel size (in column Defs using "width" property) and then on a resize event completely re-calculate each column def and re-create the entire DataTable, calling .destroy first. There may be other ideas out there, but remember that DataTable is not an HTML Table where you can just set column widths as % and have the browser resize it. DataTable is a complex dynamic JavaScript object that can only do so much. If you think about it for a minute, on a resize where should the space be made up? From which column? Do all columns get re-sized? What about data wrapping? These are a lot of important issues that would need to be addressed .... so it is not such a simple thing as re-sizing after a panel resize. And since the 2.x version of YUI is now considered in "maintenance mode" don't expect a feature to be added, you'll most likely need to come up with a solution on your own or redesign your app. Todd |
| Page 1 of 1 | [ 6 posts ] |
| 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 |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group