vendredi 28 mars 2014

Misalignment of grid cells along with the last header cell

Hi,

We have upgraded the GXT environment from 2.3.0 to 2.3.1. We are facing an issue of misalignment of grid cells along with the last header cell.

There is a mismatch between the last column and the rows. Rows ends before the last column and values are not getting displayed correctly.

This issue is observed on IE, Firefox and Safari browsers.

The misalignment gap increases with the increased number of columns and headers.

A sample code displaying the same is pasted below along with screen shots displaying the misalignment:



Screenshot:

Attachment 48475

Code:



import java.io.Serializable;

import java.util.ArrayList;

import java.util.List;



import com.extjs.gxt.ui.client.data.BaseModel;

import com.extjs.gxt.ui.client.data.ModelData;

import com.extjs.gxt.ui.client.store.ListStore;

import com.extjs.gxt.ui.client.widget.grid.CellSelectionModel;

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.grid.HeaderGroupConfig;

import com.google.gwt.core.client.EntryPoint;

import com.google.gwt.user.client.ui.RootPanel;



public class SampleGridWidget implements GridWidget

{

private Grid grid;

ArrayList<EmpPojo> emp = new ArrayList<EmpPojo>();

ListStore<EmpPojo> store = new ListStore<EmpPojo>();



public void onModuleLoad()

{

List<ColumnConfig> col = new ArrayList<ColumnConfig>();



emp.add( new EmpPojo(1, "Jill", 25, "10-Oct-1989","7702054533","jill@abc.com" ) );

emp.add( new EmpPojo(2, "Deena", 35, "2-Nov-1980", "8954712566", "deena@abc.com" ) );



ColumnConfig column = new ColumnConfig();

column.setId( "eID" );

column.setHeaderHtml( "Enrollment ID" );

column.setWidth( 100 );

col.add( column );



column = new ColumnConfig();

column.setId( "name" );

column.setHeaderHtml("Name");

column.setWidth( 100 );

col.add( column );



column = new ColumnConfig();

column.setId( "age" );

column.setHeaderHtml( "Age" );

column.setWidth( 100 );

col.add( column );



column = new ColumnConfig();

column.setId( "DOB" );

column.setHeaderHtml( "DOB" );

column.setWidth( 100 );

col.add( column );



column = new ColumnConfig();

column.setId( "contact" );

column.setHeaderHtml( "Contact" );

column.setWidth( 100 );

col.add( column );



column = new ColumnConfig();

column.setId( "emailID" );

column.setHeaderHtml( "Email ID" );

column.setWidth( 100 );

col.add( column );



ColumnModel cm = new ColumnModel( col );



store.add(emp);



grid = new Grid<EmpPojo>(store, cm);

grid.setAutoHeight(true);

grid.setAutoWidth(true);

grid.setSelectionModel(new CellSelectionModel<ModelData>());



RootPanel.get().add(grid); }





}



public class EmpModel extends BaseModel implements Serializable{



private static final long serialVersionUID = 1L;



public EmpModel(int i, String string, int j, String string2, String k, String string3) {

set( "eID", i );

set( "name", string );

set( "age", j );

set( "DOB", string2 );

set( "contact", k );

set( "emailID", string3 );

}



}



Is there a workaround for this bug?



Thanks,

Shweta


Attached Images






Aucun commentaire:

Enregistrer un commentaire