PDA

View Full Version : Widgets (like Button / IconButton) in Table



mmiotk
25 Apr 2008, 4:00 AM
I could in myGWT insert widgets (like Button / IconButton) to the cell of Table, but in ExtGWT I can't. Is it bug?


private ContentPanel genTable() {
List<TableColumn> columns = new ArrayList<TableColumn>();
TableColumn tc1 = new TableColumn("Name", "Name", 150);
TableColumn tc2 = new TableColumn("Action1", "Action1", 150);
TableColumn tc3 = new TableColumn("Action2", "Action2", 150);
columns.add(tc1);
columns.add(tc2);
columns.add(tc3);

Table tbl = new Table(new TableColumnModel(columns));
tbl.selectionMode = SelectionMode.SINGLE;
tbl.horizontalScroll = true;

for (int i = 0; i < 10; i++) {
Object[] values = new Object[3];
values[0] = "Record " + i;
values[1] = new IconButton("cbs-icon-table-up");
values[2] = new Button("Click");
TableItem item = new TableItem(values);
tbl.add(item);
}

ContentPanel panel = new ContentPanel();
panel.collapsible = false;
panel.frame = false;
panel.animCollapse = false;
panel.setIconStyle("icon-table");
panel.setHeading("Table Demo");
panel.setLayout(new FitLayout());
panel.add(tbl);
panel.setSize(575, 350);
return panel;
}

The generated table contains 10 records with the content in first column, but second and third columns are empty. With myGWT I saw there icon and button.

(I work with Firefox browser)

darrellmeyer
25 Apr 2008, 11:47 AM
If you are adding widgets to the table then you need to set the bulkRender field to false.


table.bulkRender = false;
// type in beta1
table.buildRender = false;

Let me know that does not work for you.

flow
23 Jun 2008, 9:07 AM
Using RC1b
Why isn't there a flag "bulkRender" in the TreeTable?

flow
23 Jun 2008, 10:06 AM
Issue has opened in a separate thread:
http://extjs.com/forum/showthread.php?t=39363