siberian
28 Dec 2009, 3:44 PM
I need to have my UI do RowEditing but also need a RowExpander. Right now, clicking on the Expander also invokes the Editor so they are locked in power struggle.
Closing the Editor leaves the expansion but its really funky looking.
I saw a post that addressed this for ExtJS but nothing for GXT.
Anyone know how to get GXT to properly handle this? The real goal is :
IF expander is closed, clicking a non expander field (eg: not the first column) starts up the roweditor
IF expander is open, clicking a non-expander field does nothing
... Data retrieval code removed ..
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
RowExpander expander = new RowExpander() ;
XTemplate tpl = XTemplate.create("<p><b>Company:</b> {name}</p><br><p><b>Summary:</b> {desc}</p>");
expander.setTemplate(tpl);
columns.add(expander);
TextField<String> text = new TextField<String>();
text.setAllowBlank(false);
column = new ColumnConfig("name", "Name", 200);
column.setEditor(new CellEditor(text));
columns.add(column);
ColumnModel cm = new ColumnModel(columns);
final RowEditor re = new RowEditor();
ContentPanel cp = new ContentPanel();
cp.setHeading("Expander Rows, Collapse and Force Fit");
cp.setIconStyle("icon-table");
cp.setAnimCollapse(false);
cp.setCollapsible(true);
cp.setLayout(new FitLayout());
cp.setSize(600, 300);
Grid<BeanModel> grid = new Grid<BeanModel>(store, cm);
grid.addPlugin(expander);
grid.addPlugin(re);
grid.getView().setForceFit(true);
cp.add(grid);
add(cp);
Here is a picture
http://snappydog.com/ExpanderVsEditor.png
Closing the Editor leaves the expansion but its really funky looking.
I saw a post that addressed this for ExtJS but nothing for GXT.
Anyone know how to get GXT to properly handle this? The real goal is :
IF expander is closed, clicking a non expander field (eg: not the first column) starts up the roweditor
IF expander is open, clicking a non-expander field does nothing
... Data retrieval code removed ..
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
RowExpander expander = new RowExpander() ;
XTemplate tpl = XTemplate.create("<p><b>Company:</b> {name}</p><br><p><b>Summary:</b> {desc}</p>");
expander.setTemplate(tpl);
columns.add(expander);
TextField<String> text = new TextField<String>();
text.setAllowBlank(false);
column = new ColumnConfig("name", "Name", 200);
column.setEditor(new CellEditor(text));
columns.add(column);
ColumnModel cm = new ColumnModel(columns);
final RowEditor re = new RowEditor();
ContentPanel cp = new ContentPanel();
cp.setHeading("Expander Rows, Collapse and Force Fit");
cp.setIconStyle("icon-table");
cp.setAnimCollapse(false);
cp.setCollapsible(true);
cp.setLayout(new FitLayout());
cp.setSize(600, 300);
Grid<BeanModel> grid = new Grid<BeanModel>(store, cm);
grid.addPlugin(expander);
grid.addPlugin(re);
grid.getView().setForceFit(true);
cp.add(grid);
add(cp);
Here is a picture
http://snappydog.com/ExpanderVsEditor.png