Re: DataGrid auto-set column width
Yeah, it might be a solution (not so nice and clean, but solution)...
But, look at this
http://gwt.google.com/samples/Showcase/Showcase.html#!CwDataGrid
They've made GridTable without setting column width (there is no width
attribute on any element).
On Oct 22, 5:18 pm, jaga <j.annes...@gmail.com> wrote:
> Okay - for the first solution I did as follows:
> 1) for each row of data
> 1.1) for each field
> 1.1.1) count the number of characters
> 1.1.2) keep a running maximum
> 2) finally you have an array of maximum sizes where each index
> corresponds to a column, e.g. List<Integer> maxes;
> 3) for each cell column
> 3.1) set the width to the maximum using the unit EM.
> Note: this is likely to make the column a little bigger than required.
> You can also try the Unit EX
>
> HTH
>
> On Oct 14, 2:13 pm, misko237 <misk...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I have tried with first solution, but I couldn't manage to read real
> > cell element width. Did you succeed? Second solution is not an option
> > for me.
>
> > On Oct 13, 2:57 pm,jaga<j.annes...@gmail.com> wrote:
>
> > > I have the same problem.
>
> > > For me there are two solutions:
> > > 1) calculate the maximum field width at runtime by inspecting the row
> > > data. Then set the field header size.
> > > 2) leave as stock and listen for a mouse click or similar on each
> > > field header and then resize it.
>
> > > On Oct 10, 2:49 pm, misko237 <misk...@gmail.com> wrote:
>
> > > > I have a problem with DataGrid in gwt 2.4. I made table with
> > > > CellTable, and everything worked fine. But I needed fixed header, and
> > > > then just replaced CellTable with DataGrid. I had problem with .css
> > > > file, but than has been resolved.
>
> > > > Now, the problem is that every column have fixed width. I need each
> > > > column width to be set as the widest cell in entire column.
>
> > > > Can someone help to make old looking, but with fixed header.
>
> > > > Thanks!
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home