Re: CellList grid

2011-11-07 Thread Danny Kirchmeier
It's a bit of a hack, but since the cell list is just a list of Divs, you 
can use the CSS3 columns (but watch out, IE9 doesn't support this, and only 
the most recent version of opera does)

public void setColumns(int columns) {
if(columns  1) columns = 1;

Style style = cellList.getElement().getStyle();
String cols = String.valueOf(columns);
/* You could used deferred binding here if you weren't lazy */
style.setProperty(MozColumnCount, cols);
style.setProperty(WebkitColumnCount, cols);
style.setProperty(columnCount, cols);
}

public void setColumnPadding(int width) {
if(width  0) width = 0;

Style style = cellList.getElement().getStyle();
style.setProperty(MozColumnGap, width, Style.Unit.PX);
style.setProperty(WebkitColumnGap, width, Style.Unit.PX);
style.setProperty(columnGap, width, Style.Unit.PX);
}

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/1I8AVzGr_tYJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



CellList grid

2011-11-06 Thread noach
Is there a way to display elements of a cell list in a grid format?
For example, if there were 8 items, the cells might be arranged as
follows:

Item1  Item4  Item7
Item2  Item5  Item8
Item3  Item6

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.