The code below shows a table in the center of a DockLayoutPanel.

If you run this code you'll see that the header is not aligned with
the data when the horizontal bar shows up.

If there's no scrolling then the header is aligned correctly.

Tested with GWT2.4 on

IE8 Windows7 and IE7 WinXP

With Chrome it works.

Is there a work around?
Am I doing something wrong?


    public void onModuleLoad()
        {
                testDockLayoutPanelWithDataGrid();
        }

        public void testDockLayoutPanelWithDataGrid()
        {
                final DockLayoutPanel p = new DockLayoutPanel(Unit.PX);

                HTML html = new HTML("north");
                html.getElement().getStyle().setBackgroundColor("red");
                p.addNorth(html, 30);

                html = new HTML("east");
                html.getElement().getStyle().setBackgroundColor("blue");
                p.addEast(html, 200);

                html = new HTML("west");
                html.getElement().getStyle().setBackgroundColor("green");
                p.addWest(html, 200);

                DataGrid center = createTable();
                p.add(center);

                RootLayoutPanel rp = RootLayoutPanel.get();
                rp.add(p);
        }

        DataGrid createTable()
        {
                ArrayList<HashMap> list = new ArrayList<HashMap>();

                HashMap row = new HashMap();
                row.put("1", true);
                row.put("2", "Model ABC");
                row.put("3", "1X1.5-6");
                row.put("4", "0.344");
                row.put("5", "IRON");
                row.put("6", "3,500");
                row.put("7", "102");
                row.put("8", "4.458");
                row.put("9", "57.5");
                row.put("10", "31.403");
                row.put("11", "5.5");

                list.add(row);

                DataGrid table = new DataGrid();

                Column columnDef2 = new Column<HashMap, Boolean>(new 
CheckboxCell())
                {
                        @Override
                        public Boolean getValue(HashMap object)
                        {
                                return (Boolean) object.get("1");
                        }
                };
                table.addColumn(columnDef2, "1");
                table.setColumnWidth(columnDef2, 100, Unit.PX);

                Column columnDef = new Column<HashMap, String>(new TextCell())
                {
                        @Override
                        public String getValue(HashMap object)
                        {
                                return (String) object.get("2");
                        }
                };
                table.addColumn(columnDef, "2");
                table.setColumnWidth(columnDef, 100, Unit.PX);

                columnDef = new Column<HashMap, String>(new TextCell())
                {
                        @Override
                        public String getValue(HashMap object)
                        {
                                return (String) object.get("3");
                        }
                };
                table.addColumn(columnDef, "3");
                table.setColumnWidth(columnDef, 100, Unit.PX);

                columnDef = new Column<HashMap, String>(new TextCell())
                {
                        @Override
                        public String getValue(HashMap object)
                        {
                                return (String) object.get("4");
                        }
                };
                table.addColumn(columnDef, "4");
                table.setColumnWidth(columnDef, 100, Unit.PX);

                columnDef = new Column<HashMap, String>(new TextCell())
                {
                        @Override
                        public String getValue(HashMap object)
                        {
                                return (String) object.get("5");
                        }
                };
                table.addColumn(columnDef, "5");
                table.setColumnWidth(columnDef, 100, Unit.PX);

                columnDef = new Column<HashMap, String>(new TextCell())
                {
                        @Override
                        public String getValue(HashMap object)
                        {
                                return (String) object.get("6");
                        }
                };
                table.addColumn(columnDef, "6");
                table.setColumnWidth(columnDef, 100, Unit.PX);

                columnDef = new Column<HashMap, String>(new TextCell())
                {
                        @Override
                        public String getValue(HashMap object)
                        {
                                return (String) object.get("7");
                        }
                };
                table.addColumn(columnDef, "7");
                table.setColumnWidth(columnDef, 100, Unit.PX);

                columnDef = new Column<HashMap, String>(new TextCell())
                {
                        @Override
                        public String getValue(HashMap object)
                        {
                                return (String) object.get("8");
                        }
                };
                table.addColumn(columnDef, "8");
                table.setColumnWidth(columnDef, 100, Unit.PX);

                columnDef = new Column<HashMap, String>(new TextCell())
                {
                        @Override
                        public String getValue(HashMap object)
                        {
                                return (String) object.get("9");
                        }
                };
                table.addColumn(columnDef, "9");
                table.setColumnWidth(columnDef, 100, Unit.PX);

                columnDef = new Column<HashMap, String>(new TextCell())
                {
                        @Override
                        public String getValue(HashMap object)
                        {
                                return (String) object.get("10");
                        }
                };
                table.addColumn(columnDef, "10");
                table.setColumnWidth(columnDef, 100, Unit.PX);

                columnDef = new Column<HashMap, String>(new TextCell())
                {
                        @Override
                        public String getValue(HashMap object)
                        {
                                return (String) object.get("11");
                        }
                };
                table.addColumn(columnDef, "11");
                table.setColumnWidth(columnDef, 100, Unit.PX);

                table.setRowCount(list.size(), true);
                table.setRowData(0, list);

                return table;
        }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to