Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Tim B. on November 25, 2008, 01:18:35 pm



Title: Feature Request - function to autosize cols in a table
Post by: Tim B. on November 25, 2008, 01:18:35 pm
It is difficult to know how to size columns in a table in program, especially when creating the table dynamically.  The best you can do is guess based on the estimated size of what is going to be returned. 

If you double-click the heading in between two columns it auto-sizes the left column.  It would be useful if there was a function or attribute which could do this.


Title: Re: Feature Request - function to autosize cols in a table
Post by: Tim S. on November 25, 2008, 02:43:42 pm
Please add my vote to this request also.


Title: Re: Feature Request - function to autosize cols in a table
Post by: Reuben B. on November 25, 2008, 09:45:53 pm
It is difficult to know how to size columns in a table in program, especially when creating the table dynamically.  The best you can do is guess based on the estimated size of what is going to be returned. 

If you double-click the heading in between two columns it auto-sizes the left column.  It would be useful if there was a function or attribute which could do this.

I don't know if you have noticed but that double-click only sizes based on the data that the GDC knows about i.e. the rows that are visible.

You can set the width attribute of the column by manipulating the DOM tree.  I've done that successfully in a routine that essentially takes the output from a SQL statement and dumps it into a DISPLAY ARRAY.  For each column set the width attribute to an appropriate value for the data in that column.


Title: Re: Feature Request - function to autosize cols in a table
Post by: Tim B. on November 26, 2008, 10:15:10 am
I don't know if you have noticed but that double-click only sizes based on the data that the GDC knows about i.e. the rows that are visible.

You can set the width attribute of the column by manipulating the DOM tree.  I've done that successfully in a routine that essentially takes the output from a SQL statement and dumps it into a DISPLAY ARRAY.  For each column set the width attribute to an appropriate value for the data in that column.
I'd not noticed this, but I shouldn't think It will be a big problem.  I'd thought of checking the length of data in each column in the array (as well as the column title), but it's bit of a long winded way of doing things, and the WIDTH attribute is (I think) in grid chars which isn't really the same as the width the data occupies in the table due to the differences in font size.