Datagrid with resiable column

567 views
Skip to first unread message

Dayananda B V

unread,
May 3, 2012, 6:40:26 AM5/3/12
to Google Web Toolkit
Hi All,

How to make DataGrid with resizable column.

appreciate your help

thanks
Daya

Jens

unread,
May 3, 2012, 6:50:10 AM5/3/12
to google-we...@googlegroups.com

Dayananda B V

unread,
May 3, 2012, 9:02:46 AM5/3/12
to Google Web Toolkit
Hi Jens,
thank you so much for replay, i tired the url you pointed out. how
ever i am not able resize column,
please check below demo, can you please let me what could be reason.

import java.util.List;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.cellview.client.TextColumn;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.view.client.ListDataProvider;

public class BrowseGroupTest implements EntryPoint {

ListDataProvider list = new ListDataProvider();

/**
* This is the entry point method.
*/
public void onModuleLoad() {

// new TestTree().show();
RootPanel rp = RootPanel.get();
rp.setSize("600", "500");

AbsolutePanel absolutePanel = new AbsolutePanel();
absolutePanel.setStyleName("gwt-DialogBox .Caption");
rp.add(absolutePanel, 7, 7);
absolutePanel.setSize("680px", "553px");

CellTable<DataList> cellTable = new CellTable<DataList>();
absolutePanel.add(cellTable, 10, 10);
cellTable.setSize("104px", "144px");

TextColumn<DataList> textColumn = new TextColumn<DataList>() {
@Override
public String getValue(DataList dataList) {
return dataList.code;
}
};
cellTable.addColumn(textColumn, "Code");
TextColumn<DataList> textColumn1 = new TextColumn<DataList>() {
@Override
public String getValue(DataList dataList) {
return dataList.name;
}
};
cellTable.addColumn(textColumn1, "Name");

List list1 = list.getList();
list1.add(new DataList("asdfaf asdfasdfasdfass sadfasdfasfdasdf",
"asdf ashdfasdhfoih"));
list1.add(new DataList("asdfaf asdfasdfasdfass sadfasdfasfdasdf",
"asdf ashdfasdhfoih"));
list.addDataDisplay(cellTable);

new ResizableHeader("Code", cellTable, textColumn);

}
class DataList {
String code;
String name;

public DataList(String code, String name) {
this.code = code;
this.name = name;
}
}


On May 3, 3:50 pm, Jens <jens.nehlme...@gmail.com> wrote:
> https://groups.google.com/d/topic/google-web-toolkit/y66eBBeOarI/disc...
>
> -- J.
>
> Am Donnerstag, 3. Mai 2012 12:40:26 UTC+2 schrieb Dayananda B V:
>
>
>
>
>
> > Hi All,
>
> > How to make DataGrid with resizable column.
>
> > appreciate your help
>
> > thanks
> > Daya- Hide quoted text -
>
> - Show quoted text -

Dayananda B V

unread,
May 3, 2012, 9:22:39 AM5/3/12
to Google Web Toolkit
it's worked, problem in setting width of table.
> > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages