1. #1
    Ext GWT Premium Member
    Join Date
    Jun 2009
    Posts
    3
    Vote Rating
    0
    paul.hayden is on a distinguished road

      0  

    Default Missing Column Headers in GXT Grid Component within GWT VerticalPanel

    Missing Column Headers in GXT Grid Component within GWT VerticalPanel


    Hi,

    I wonder if you can help me with this problem. We have an existing GWT 1.5.2 application and are interested in using GXT components within it. To this end, I have successfully placed a GXT grid component within a GWT VerticalPanel but only if the VerticalPanel's horizontal alignment is set to ALIGN_LEFT. If I change it to ALIGN_CENTER or ALIGN_RIGHT the grid's column headers disappear from view.

    Sample code follows.

    My entry point class:

    public
    class Application implements EntryPoint
    {
    publicvoid onModuleLoad()
    {
    AppPropsGrid appPropsGrid =
    new AppPropsGrid(10);

    VerticalPanel displayPanel =
    new VerticalPanel();
    displayPanel.setHorizontalAlignment(HasAlignment.
    ALIGN_CENTER);
    displayPanel.add(appPropsGrid);

    RootPanel pageRootPanel = RootPanel.get(
    "rootPanel");
    pageRootPanel.add(displayPanel);
    }


    }

    The AppPropsGrid component class:


    public
    class AppPropsGrid extends LayoutContainer
    {
    private BasePagingLoader<BasePagingLoadConfig,PagingLoadResult<ApplicationProperty>> loader;

    private ListStore<BeanModel> store;

    private PagingToolBar toolBar;

    privateintnoRecords;

    private UserDetailsRPCAsync userDetailsRPC;


    public AppPropsGrid(int noOfRecords)
    {
    super();
    this.setNoRecords(noOfRecords);

    userDetailsRPC = RPCHelper.getUserDetailsService();
    }

    publicint getNoRecords()
    {
    returnthis.noRecords;
    }

    publicvoid setNoRecords(int noRecords)
    {
    this.noRecords = noRecords;
    }

    @Override

    protectedvoid onRender(Element parent, int index)
    {
    super.onRender(parent, index);

    FlowLayout layout =
    new FlowLayout(10);
    setLayout(layout);

    GetAppPropsRpcProxy rpcProxy =
    new GetAppPropsRpcProxy();

    if( this.loader == null )
    {
    BeanModelReader<BasePagingLoadConfig> reader =
    new BeanModelReader<BasePagingLoadConfig>();

    this.loader = new BasePagingLoader<BasePagingLoadConfig,PagingLoadResult<ApplicationProperty>>(rpcProxy, reader);
    // this.loader.setRemoteSort(true);


    this.store = new ListStore<BeanModel>(this.loader);

    toolBar = new PagingToolBar(this.getNoRecords());
    toolBar.bind(this.loader);
    }

    this.loader.load(0, this.getNoRecords());

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

    ColumnConfig column =
    new ColumnConfig("name",Translator.translate("name"),200);
    columns.add(column);

    column =
    new ColumnConfig("typeCode",Translator.translate("type"),80);
    columns.add(column);

    column =
    new ColumnConfig("value",Translator.translate("value"),200);
    columns.add(column);

    ColumnModel cm =
    new ColumnModel(columns);

    Grid<BeanModel> grid =
    new Grid<BeanModel>(this.store, cm);
    grid.setLoadMask(
    true);
    grid.setBorders(
    true);
    grid.setAutoExpandColumn(
    "name");

    ContentPanel gridPanel =
    new ContentPanel();
    gridPanel.setFrame(
    true);
    gridPanel.setCollapsible(
    true);
    gridPanel.setAnimCollapse(
    false);
    gridPanel.setButtonAlign(HorizontalAlignment.
    CENTER);
    gridPanel.setHeading(
    "Test Heading");
    gridPanel.setLayout(
    new FitLayout());

    gridPanel.add(grid);
    gridPanel.setSize(600,400);
    gridPanel.setBottomComponent(
    toolBar);

    add(gridPanel);

    }

    public BasePagingLoader<BasePagingLoadConfig,PagingLoadResult<ApplicationProperty>> getLoader()
    {
    returnloader;
    }

    publicvoid refresh()
    {
    this.reset();
    this.getLoader().load();
    }

    public ListStore<BeanModel> getStore()
    {
    returnstore;
    }

    publicvoid reset()
    {
    this.getStore().removeAll();
    }

    privateclass GetAppPropsRpcProxy extends RpcProxy<BasePagingLoadConfig,PagingLoadResult<ApplicationProperty>>
    {
    @Override

    protectedvoid load(BasePagingLoadConfig loadConfig,
    AsyncCallback<PagingLoadResult<ApplicationProperty>> callback)
    {
    BasePagingLoadConfig config = (BasePagingLoadConfig)loadConfig;

    userDetailsRPC.getApplicationProperties(
    Cookies.getCookie(CommonConstants.
    SESSION_COOKIE_NAME),
    config,
    callback );
    }
    }
    }


  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,506
    Vote Rating
    54
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Nobody in this folder will be able to help. Try the GXT Help folder.

  3. #3
    Ext GWT Premium Member
    Join Date
    Jun 2009
    Posts
    3
    Vote Rating
    0
    paul.hayden is on a distinguished road

      0  

    Default Apologies

    Apologies


    Sorry, my mistake.

Thread Participants: 1