PDA

View Full Version : Need help: Grid in WebDesktop



kevinswiss
29 Nov 2011, 6:28 AM
Hello,

I have a question about Grid in WebDesktop.

I have a Window in my WebDesktop. In this window, I have added some TextFields, buttons, as well as Grids (com.extjs.gxt.ui.client.widget.grid). It works smoothly. However, when I click "Minimize" or "Close" on the toolbar of Window, and then re-open this Window, my Grids are hidden. You can see it from my pictures. Could someone please help me? Thanks in advance.

Colin Alworth
1 Dec 2011, 4:59 PM
Can you provide a code sample that demonstrates this issue? Preferably something that implements EntryPoint, and has as little extraneous code (other fields, buttons, etc), but still demonstrates the issue.

In addition to making it easier for readers in the community to help narrow down the issue, you may find the bug while creating the sample.

kevinswiss
6 Dec 2011, 5:17 AM
Thank you Colin Alworth.

Here is my code. In fact, my Window is extended "LayoutContainer". When I display it, there has not issue. But after re-open this Window, the Grids are disappeared.



FieldSet fieldSetDoc = new FieldSet();
fieldSetDoc.setHeading("Document detail");
fieldSetDoc.setCollapsible(true);

FormLayout layoutDoc = new FormLayout();
layoutDoc.setLabelWidth(175);
layoutDoc.setDefaultWidth(300);

fieldSetDoc.setLayout(layoutDoc);

ColumnConfig columnDoc = new ColumnConfig();
columnDoc.setId("documentTitle");
columnDoc.setHeader("Document Title");
columnDoc.setWidth(150);
configsDoc.add(columnDoc);

ColumnModel cmDoc = new ColumnModel(configsDoc);

ContentPanel cpDoc = new ContentPanel();
cpDoc.setBodyBorder(false);
cpDoc.setHeaderVisible(false);
cpDoc.setLayout(new FitLayout());
cpDoc.setSize(480, 120);

GridFilters filtersDoc = new GridFilters();
filtersDoc.setLocal(true);

StringFilter nameDocFltr = new StringFilter("documentTitle");

filtersDoc.addFilter(nameDocFltr);

final Grid<ModelDataDocument> gridDoc = new Grid<ModelDataDocument>(document, cmDoc);
gridDoc.setStyleAttribute("borderTop", "none");
gridDoc.setAutoExpandColumn("documentTitle");
gridDoc.setBorders(true);
gridDoc.addPlugin(filtersDoc);

ToolBar toolBarDoc = new ToolBar();

Button addBtnDoc = new Button("Add");
Button removeBtnDoc = new Button("Remove");


toolBarDoc.add(addBtnDoc);
toolBarDoc.add(removeBtnDoc);
cpDoc.setTopComponent(toolBarDoc);
toolBarDoc.setAlignment(HorizontalAlignment.RIGHT);
cpDoc.setStyleAttribute("margin-bottom", "15px");

cpDoc.add(gridDoc);
fieldSetDoc.add(cpDoc, new FormData("98%"));

titleDocument.setFieldLabel("Document title");
titleDocument.setStyleAttribute("margin-bottom", "3px");
titleDocument.setAllowBlank(false);
fieldSetDoc.add(titleDocument, new FormData("98%"));

fileProduct.setName("uploadedFileProduct");
fileProduct.setFieldLabel("Document file");
fileProduct.setStyleAttribute("margin-bottom", "3px");
fileProduct.setAllowBlank(false);
fieldSetDoc.add(fileProduct, new FormData("98%"));

lbLanguage.setStyleName("myCountryList");
Label labelLanguage = new Label("Language:");
labelLanguage.setWidth(184);
labelLanguage.setStyleAttribute("font-size", "12px");
labelLanguage.setStyleAttribute("text-align", "left");
labelLanguage.setStyleAttribute("margin-bottom", "3px");
fieldSetDoc.add(labelLanguage);

formProduct.add(fieldSetDoc, new FormData("98%"));
vp.add(formProduct);




Any idea? Thanks!