-
20 Aug 2010 1:56 AM #1
[2.2.0 RC] Grid with CheckBoxSelectionModel doesn't paint the table
[2.2.0 RC] Grid with CheckBoxSelectionModel doesn't paint the table
Hello.
I updated my project to the last version and today I realized that my grid is not showing any elements on it.
If I use the inspector on Chrome I can find the content in the code, but the grid only shows the header, the body white. It doesn't paint even the scroll or the empty rows, just the header and a huge white space.
It was working on 2.2.0 beta.
Thanks.
-
20 Aug 2010 2:02 AM #2
Please post a fully working testcase that implements EntryPoint. You will see that all examples work without any updates widht GXT 2.2 rc1
-
20 Aug 2010 2:59 AM #3
Hello Sven.
Here is my code.
I think the problem comes from using a layout with AccordionLayout.
As you can see it's the same code than in your example, but with the diference of the AccordionLayout.Code:// Main layout LayoutContainer filtrosPanel = new LayoutContainer(new AccordionLayout()); filtrosPanel.setSize(100, 500); filtrosPanel.setBorders(true); filtrosPanel.setScrollMode(Scroll.AUTOY); filtrosPanel.setId("acordeonFiltros"); // Inside layout ContentPanel filtroPanel = new ContentPanel(new RowLayout()); filtroPanel.setAnimCollapse(false); filtroPanel.setSize(100, 500); filtroPanel.setHeading("Proof container"); // Load datas List<VFiltro> filtro = filtros.get(i); BeanModelFactory filtroFactory = BeanModelLookup.get().getFactory(VFiltro.class); List<BeanModel> filtroModel = filtroFactory.createModel(filtro); final ListStore<BeanModel> storeFiltro = new ListStore<BeanModel>(); storeFiltro.add(filtroModel); // CheckBoxes plugin CheckBoxSelectionModel<BeanModel> sm = new CheckBoxSelectionModel<BeanModel>(); List<ColumnConfig> configs = new ArrayList<ColumnConfig>(); configs.add(sm.getColumn()); ColumnConfig column = new ColumnConfig(); column.setSortable(false); column.setMenuDisabled(true); column.setId("descripcion"); column.setHeader("Descripción"); column.setWidth(240); configs.add(column); ColumnModel cm = new ColumnModel(configs); // Grid + plugin Grid<BeanModel> grid = new Grid<BeanModel>(storeFiltro, cm); grid.setColumnReordering(true); grid.getAriaSupport().setLabelledBy(filtroPanel.getHeader().getId() + "-label"); grid.addPlugin(sm); filtroPanel.add(grid, new RowData(1,1)); filtrosPanel.add(filtroPanel);
Thank you again.
-
20 Aug 2010 3:02 AM #4
Can you please post some fully working testcase that implements EntryPoint for this?
-
20 Aug 2010 3:04 AM #5
I did a testcase with an AccordionLayout but itstill renders fine.
-
22 Aug 2010 11:04 PM #6
Hello Sven.
I've been making some tests and I've been always getting the same rendering problem.
It seems something has changed from the last version and now my grid is not taking the correct height, look the next code:
In 2.2.0 beta I had the next code and it was rendering the height perfectly.Code:<div class="x-grid3" role="presentation" styles="width: 260px; height 21px;"> <div class="x-grid3-viewport" role="presentation"> <div class="x-grid3-header" role="presentation">_</div> <div class="x-grid3-scroller" role="presentation" styles="width: 260px; height: 0px;"> <--- HEIGHT: 0px; <div class="x-grid3-body" role="presentation"> --- rows ---
Now I have to set the height in order to render it.Code:Grid<BeanModel> grid = new Grid<BeanModel>(storeFiltro, cm); grid.getView().setAutoFill(true); grid.setSelectionModel(sm); grid.addPlugin(sm);
So I guess "grid.getView().setAutoFill(true);" is not working correctly in this last version, isn't it?.Code:Grid<BeanModel> grid = new Grid<BeanModel>(storeFiltro, cm); grid.setSelectionModel(sm); grid.addPlugin(sm); grid.setHeight(panelHeight);
Thanks for your help.
-
23 Aug 2010 1:22 AM #7
AutoFIll is not setting any height. You should always size your grid. Can you please post a fully working testcase for your issue? According to your codesnippets you are sizing your grid. Probably there is an issue in your layoutchain.
-
23 Aug 2010 2:21 AM #8
Here is a testcase:
Code:import java.util.ArrayList; import java.util.List; import com.extjs.gxt.samples.resources.client.TestData; import com.extjs.gxt.samples.resources.client.model.Stock; import com.extjs.gxt.ui.client.Style.Scroll; import com.extjs.gxt.ui.client.data.BeanModel; import com.extjs.gxt.ui.client.store.ListStore; import com.extjs.gxt.ui.client.widget.ContentPanel; import com.extjs.gxt.ui.client.widget.LayoutContainer; import com.extjs.gxt.ui.client.widget.grid.CheckBoxSelectionModel; import com.extjs.gxt.ui.client.widget.grid.ColumnConfig; import com.extjs.gxt.ui.client.widget.grid.ColumnModel; import com.extjs.gxt.ui.client.widget.grid.Grid; import com.extjs.gxt.ui.client.widget.layout.AbsoluteLayout; import com.extjs.gxt.ui.client.widget.layout.AccordionLayout; import com.extjs.gxt.ui.client.widget.layout.RowData; import com.extjs.gxt.ui.client.widget.layout.RowLayout; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.PopupPanel; import com.google.gwt.user.client.ui.RootPanel; public class Test implements EntryPoint { public void onModuleLoad() { final PopupPanel popUp = new PopupPanel(true); ContentPanel popUpContent = new ContentPanel(new AbsoluteLayout()); popUpContent.setHeaderVisible(false); popUpContent.setSize(400, 600); // Accordion LayoutContainer filtrosPanel = new LayoutContainer(new AccordionLayout()); filtrosPanel.setSize(300, 600); filtrosPanel.setBorders(true); filtrosPanel.setScrollMode(Scroll.AUTOY); filtrosPanel.setId("acordeonFiltros"); // First panel ContentPanel filtroPanel = new ContentPanel(new RowLayout()); filtroPanel.setAnimCollapse(false); filtroPanel.setSize(300, 600); filtroPanel.setHeading("Testing grid"); List<Stock> stocks = TestData.getStocks(); List<ColumnConfig> configs = new ArrayList<ColumnConfig>(); final CheckBoxSelectionModel<Stock> sm = new CheckBoxSelectionModel<Stock>(); configs.add(sm.getColumn()); ColumnConfig column = new ColumnConfig(); column.setId("name"); column.setHeader("Company"); column.setWidth(240); configs.add(column); ListStore<Stock> store = new ListStore<Stock>(); store.add(stocks); ColumnModel cm = new ColumnModel(configs); Grid<Stock> grid = new Grid<Stock>(store, cm); grid.setSelectionModel(sm); grid.addPlugin(sm); grid.getView().setAutoFill(true); filtroPanel.add(grid, new RowData(1,1)); filtrosPanel.add(filtroPanel); popUpContent.add(filtrosPanel); popUp.add(popUpContent); popUp.show(); } }
-
23 Aug 2010 2:26 AM #9
That testcase renders fine for me against 2.2 RC1
-
23 Aug 2010 3:08 AM #10
Well then I don't know what's going on... in my project the same code but with different datas doesn't render if I doesn't use setHeight.
Anyway, at least giving a height it works
.
I am using Chrome and I made tests with Firefox too, I don't think is a navigator problem, but just in case I suggest it.
If I find out something new I will make you know.
Thanks sven.
Similar Threads
-
CheckboxSelectionModel doesn't have 'beforerowDEselect' event?
By zaqwsxqwer in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 30 Oct 2009, 3:04 AM -
Ext Grid Taking too Much time to paint 100 columns
By amitdahiya10 in forum Ext 1.x: Help & DiscussionReplies: 0Last Post: 21 Aug 2008, 8:05 AM -
THE grid doesn't work in table
By looksun in forum Ext 1.x: Help & DiscussionReplies: 2Last Post: 28 Jun 2007, 6:38 PM -
After rendering grid, loadData doesn't paint new records
By booshan in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 5 Apr 2007, 2:15 PM


Reply With Quote