Thanks Patrizio for your suggestions but its not working for me. I am  
sending my code now. The top Panel have a BorderLayout. I am only showing  
the north Panel for clarity, the order parts of BorderLayout have the same  
panel.

The centerpanel is where I am adding EditorGridPanel. You see the AsynCall  
which talks to the backend and bring the required data. When I run this  
code I only see the top row of the table. I want the table to take all the  
available space and show scroll bars if the data is more but its not  
happening. Any idea?

Panel borderPanel = new Panel();
borderPanel.setLayout(new BorderLayout());

Panel northPanel = new Panel();
northPanel.setHtml("<p>north panel</p>");
northPanel.setHeight(32);
borderPanel.add(northPanel, new BorderLayoutData(RegionPosition.NORTH));

Panel centerPanel = new Panel();
final RecordDef recordDef = new RecordDef(new FieldDef[] {
new StringFieldDef("code", 0), new StringFieldDef("name", 1),
new StringFieldDef("createdTime", 2)
});
final ColumnModel columnModel = new ColumnModel(new ColumnConfig[] {
new ColumnConfig("Code", "code"),
new ColumnConfig("Name", "name"),
new ColumnConfig("Created Time", "createdTime")
});

final Store store = new Store(recordDef);
final EditorGridPanel grid = new EditorGridPanel();
grid.setHeight("100%");
grid.setWidth("100%");
grid.setAutoScroll(true);
grid.setColumnModel(columnModel);
grid.setStore(store);

airlineService.getAll(new AsyncCallback<List<Airline>>() {
public void onFailure(Throwable arg0) {
}

public void onSuccess(List<Airline> airlines) {
for (Airline airline : airlines) {
store.add(recordDef.createRecord(
airline.toObjectArray()));
}
grid.doLayout();
}
});
centerPanel.add(grid);
centerPanel.setAutoScroll(true);

borderPanel.add(centerPanel, new BorderLayoutData(RegionPosition.CENTER));
new Viewport(borderPanel);

On Jun 3, 2009 2:55pm, Patrizio De Michele <[email protected]> wrote:
> about scrollbars could help you setAutoScroll on the container of the  
> grid,
> on the parent (usually a panel, but i have tried also with a Window) of  
> the grid.
> let me now if my suggests aren't useful.
> Bye, Pat


> 2009/6/3 Patrizio De Michele [email protected]>

> Maybe a call to the doLayout of the container could solve the problem.
> But you can set height and width with setHeight(String ...) and  
> setWidth(String ...)
> methods of the editorgridpanel, i hope it solves simply setting height  
> and width


> (eg setWidth("100%");).

> About the data not showing try calling the doLayout.
> There are also some options on the view like set setForceFit(true); or  
> setAutoFill(true);
> I hope it helps,
> Bye Patrizio

> PS About the scrollbars i'll answer later when i'll solve the problem  
> too ;)



> 2009/6/2 Bhushan [email protected]>






> Hi,



> I am using GWT 1.6.4 and GWT-Ext 2.0.6. I am trying to use

> EditorGridPanel and facing rendering problems.



> When the module loads I create a Panel (TopPanel) with BorderLayout

> and add that to the ViewPort. I then create another Panel

> (CenterPanel) and add EditorGridPanel, three buttons to the center of

> the BorderLayout Panel (TopPanel). I tried many layouts for

> CenterPanel but still not able to get what I want.



> I want the table to showup with the required data and scrollbars. All

> the three buttons comes below the table. The data for the table come

> via Async call when the module loads, so when the screen is rendered

> to the user, the data is populated in the table. But looks like the

> table gets rendered with no data and when the async process finishes

> the table gets populated but don't get resized to fit the screen so

> only show me one row.



> The problem is with the Grid, I am not getting any scrollbars.

> Secondly I don't want to define the height and width of the Grid. I

> want it to take as much as possible and show scrollbars, just like we

> do in html table by setting width and height as 100%.



> Thanks















> 



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to