I'm getting the following problem after migrating an app from SmartGWT 2.1 to 2.4
My app has a listgrid which is bound to a local datasource, which is programatically populated with data in client side. When the datasource has just one record, it is not draw when fetchData is called, until I resize the window.
The problem just occurs when I use a local datasource with just one record, I had no problem using listGrid.setRecords() ou datasources with more than one record.
I made a simple example to ilustrate that:
The following attachments show this sample window when the app is loaded (record_missing1.PNG), after clicking in the button (record_missing2_after_click_button.PNG) and after resizing the window (record_missing3_after_resize.PNG).
Note that when I click the button I can see the fields and the line in the grid, but the contents are visible just when the window is resized horizontally (vertically had no effect).
I'm facing this problem in Firefox 3.6 and IE 8. I also checked developer console for possible errors, but found nothing unusual.
Is that really a bug or is there anything I can do?
Thanks,
Matheus
My app has a listgrid which is bound to a local datasource, which is programatically populated with data in client side. When the datasource has just one record, it is not draw when fetchData is called, until I resize the window.
The problem just occurs when I use a local datasource with just one record, I had no problem using listGrid.setRecords() ou datasources with more than one record.
I made a simple example to ilustrate that:
Code:
// A simple listgrid final ListGrid g = new ListGrid(); g.setAlternateRecordStyles(true); g.setSelectionType(SelectionStyle.SINGLE); g.setWidth100(); g.setHeight100(); g.setFixedRecordHeights(false); g.setWrapCells(true); // A simple button to populated the grid final IButton b = new IButton("foo"); b.setTitle("Foo"); b.setAutoFit(true); b.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { // This is a client-only data source DataSource ds = DSComandosSessaoBRS.getNewInstance(); // That was used to check if the bug appeared also // when using ListGrid.setRecords() //ListGridRecord records[] = new ListGridRecord[2]; ListGridRecord record1 = new ListGridRecord(); ListGridRecord record2 = new ListGridRecord(); record1.setAttribute("comando", "A command"); record1.setAttribute("numeroDocumentos", "1"); record1.setAttribute("numeroOcorrencias", "1"); record1.setAttribute("numeroReferencia", "1"); //records[0] = record1; ds.addData(record1); // With a second record there's no problem //record2.setAttribute("comando", "Another command"); //record2.setAttribute("numeroDocumentos", "2"); //record2.setAttribute("numeroOcorrencias", "2"); //record2.setAttribute("numeroReferencia", "3"); //records[1]= record2; //ds.addData(record2); g.setDataSource(ds); g.setFields(getFieldsGridComandosSessao()); g.fetchData(); //g.setRecords(records); } }); // A simple window to display the grid and the button com.smartgwt.client.widgets.Window w = new com.smartgwt.client.widgets.Window(); w.setWidth(400); w.setHeight(300); w.setTitle("Foo"); w.setShowTitle(true); w.setTop(30); w.setLeft(30); w.setIsModal(true); w.setCanDragResize(true); VLayout v = new VLayout(); v.setWidth100(); v.setHeight100(); v.addMember(g); v.addMember(b); w.addItem(v); w.show();
Note that when I click the button I can see the fields and the line in the grid, but the contents are visible just when the window is resized horizontally (vertically had no effect).
I'm facing this problem in Firefox 3.6 and IE 8. I also checked developer console for possible errors, but found nothing unusual.
Is that really a bug or is there anything I can do?
Thanks,
Matheus
Comment