timefortea
16 Jan 2009, 2:56 AM
Hi all,
I noticed that my Grid does not display correctly in IE but displays fine in Firefox. In IE it runs on past the boundary of the enclosing panel, on the right hand side. Is this a bug? Is there a way around it?
Here's my code that should re-produce it:
public class Test implements EntryPoint
{
public void onModuleLoad()
{
LayoutContainer container = new LayoutContainer();
container.setLayout(new FlowLayout(10));
List<Post> posts = new ArrayList<Post>();
posts.add(new Post("User1", "xxx", new Date(), "Here we are"));
posts.add(new Post("User2", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User3", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User4", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User5", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User6", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User7", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User8", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User9", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User10", "zzzzzzz", new Date(), "Hello there"));
BasePagingLoadResult bplr = new BasePagingLoadResult<Post>(posts, 0, 10);
MemoryProxy<BasePagingLoadResult> proxy = new MemoryProxy<BasePagingLoadResult>(bplr);
// loader
BasePagingLoader loader = new BasePagingLoader(proxy);
ListStore<Post> store = new ListStore<Post>(loader);
loader.load(0, 10);
final PagingToolBar toolBar = new PagingToolBar(10);
toolBar.bind(loader);
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
columns.add(new ColumnConfig("forum", "Forum", 100));
columns.add(new ColumnConfig("username", "Username", 100));
columns.add(new ColumnConfig("subject", "Subject", 100));
ColumnConfig date = new ColumnConfig("date", "Date", 100);
date.setDateTimeFormat(DateTimeFormat.getFormat("MM/dd/y"));
columns.add(date);
ColumnModel cm = new ColumnModel(columns);
ContentPanel gridPanel = new ContentPanel();
gridPanel.setFrame(true);
gridPanel.setCollapsible(false);
gridPanel.setAnimCollapse(false);
gridPanel.setButtonAlign(HorizontalAlignment.CENTER);
gridPanel.setHeaderVisible(false);
gridPanel.setLayout(new FitLayout());
gridPanel.setBottomComponent(toolBar);
Grid<Post> grid = new Grid<Post>(store, cm);
grid.setLoadMask(true);
grid.setBorders(true);
grid.setStripeRows(true);
gridPanel.add(grid);
container.add(gridPanel);
Viewport vp = new Viewport();
vp.setLayout(new FitLayout());
vp.add(container);
RootPanel.get().add(vp);
}
public class Post extends BaseModel implements Serializable {
protected Date dummy;
public Post() {
}
public Post(String username, String forum, Date date, String subject)
{
setUsername(username);
setForum(forum);
setDate(date);
setSubject(subject);
}
private void setUsername(String username) {
set("username", username);
}
private void setForum(String forum) {
set("forum", forum);
}
private void setDate(Date date) {
set("date", date);
}
private void setSubject(String subject) {
set("subject", subject);
}
}
}
screen1.jpg shows how this is displayed in IE (notice frame on right hand side)
screen2.jpg shows how this is displayed in Firefox (fine on right hand side)
Edit: Using GXT 1.2.1 / GWT 1.5.3 / Windows XP / IE 7 / Firefox 3
Edit 2: If I set a specific size on the 'gridPanel' panel, this goes away - but I want the panel to adjust according to the window size, I don't want to set it.
I noticed that my Grid does not display correctly in IE but displays fine in Firefox. In IE it runs on past the boundary of the enclosing panel, on the right hand side. Is this a bug? Is there a way around it?
Here's my code that should re-produce it:
public class Test implements EntryPoint
{
public void onModuleLoad()
{
LayoutContainer container = new LayoutContainer();
container.setLayout(new FlowLayout(10));
List<Post> posts = new ArrayList<Post>();
posts.add(new Post("User1", "xxx", new Date(), "Here we are"));
posts.add(new Post("User2", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User3", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User4", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User5", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User6", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User7", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User8", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User9", "zzzzzzz", new Date(), "Hello there"));
posts.add(new Post("User10", "zzzzzzz", new Date(), "Hello there"));
BasePagingLoadResult bplr = new BasePagingLoadResult<Post>(posts, 0, 10);
MemoryProxy<BasePagingLoadResult> proxy = new MemoryProxy<BasePagingLoadResult>(bplr);
// loader
BasePagingLoader loader = new BasePagingLoader(proxy);
ListStore<Post> store = new ListStore<Post>(loader);
loader.load(0, 10);
final PagingToolBar toolBar = new PagingToolBar(10);
toolBar.bind(loader);
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
columns.add(new ColumnConfig("forum", "Forum", 100));
columns.add(new ColumnConfig("username", "Username", 100));
columns.add(new ColumnConfig("subject", "Subject", 100));
ColumnConfig date = new ColumnConfig("date", "Date", 100);
date.setDateTimeFormat(DateTimeFormat.getFormat("MM/dd/y"));
columns.add(date);
ColumnModel cm = new ColumnModel(columns);
ContentPanel gridPanel = new ContentPanel();
gridPanel.setFrame(true);
gridPanel.setCollapsible(false);
gridPanel.setAnimCollapse(false);
gridPanel.setButtonAlign(HorizontalAlignment.CENTER);
gridPanel.setHeaderVisible(false);
gridPanel.setLayout(new FitLayout());
gridPanel.setBottomComponent(toolBar);
Grid<Post> grid = new Grid<Post>(store, cm);
grid.setLoadMask(true);
grid.setBorders(true);
grid.setStripeRows(true);
gridPanel.add(grid);
container.add(gridPanel);
Viewport vp = new Viewport();
vp.setLayout(new FitLayout());
vp.add(container);
RootPanel.get().add(vp);
}
public class Post extends BaseModel implements Serializable {
protected Date dummy;
public Post() {
}
public Post(String username, String forum, Date date, String subject)
{
setUsername(username);
setForum(forum);
setDate(date);
setSubject(subject);
}
private void setUsername(String username) {
set("username", username);
}
private void setForum(String forum) {
set("forum", forum);
}
private void setDate(Date date) {
set("date", date);
}
private void setSubject(String subject) {
set("subject", subject);
}
}
}
screen1.jpg shows how this is displayed in IE (notice frame on right hand side)
screen2.jpg shows how this is displayed in Firefox (fine on right hand side)
Edit: Using GXT 1.2.1 / GWT 1.5.3 / Windows XP / IE 7 / Firefox 3
Edit 2: If I set a specific size on the 'gridPanel' panel, this goes away - but I want the panel to adjust according to the window size, I don't want to set it.