1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    26
    Vote Rating
    0
    phickey is on a distinguished road

      0  

    Default Unanswered: Grid not formatting correctly in safari

    Unanswered: Grid not formatting correctly in safari


    Hi guys the grid is not formatting the columns correctly in safari. The issue does not reproduce in firefox.

    I have included two screen shots, the misaligned columns is safari, and the correctly aligned columns firefox (The ellipse for the values seams to be missing in safari, so the columns misalign). Also there seams to be a bullet point in firefox where the tabs are? What should be the default module inherited for GWT to get all of the GUI objects included?

    Screen Shot 2013-03-27 at 9.44.23 AM.pngScreen Shot 2013-03-27 at 9.45.00 AM.jpg

    Here is the code:


    package com.firecracker.hotelsfa.client.system.dataset;


    import com.firecracker.hotelsfa.client.model.IUser;
    import com.firecracker.hotelsfa.server.entity.Dataset;
    import com.firecracker.hotelsfa.server.entity.User;
    import com.google.gwt.cell.client.CheckboxCell;
    import com.google.gwt.cell.client.DateCell;
    import com.google.gwt.core.client.GWT;
    import com.google.gwt.i18n.client.DateTimeFormat;
    import com.google.gwt.user.client.rpc.AsyncCallback;
    import com.google.gwt.user.client.ui.HasHorizontalAlignment;
    import com.google.gwt.user.client.ui.IsWidget;
    import com.google.gwt.user.client.ui.Widget;
    import com.sencha.gxt.data.shared.ListStore;
    import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
    import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
    import com.sencha.gxt.widget.core.client.grid.ColumnModel;
    import com.sencha.gxt.widget.core.client.grid.Grid;


    import java.util.ArrayList;
    import java.util.Collection;
    import java.util.Date;
    import java.util.List;


    public class UserAdmin implements IsWidget {
    private static final IUser userProperties = GWT.create(IUser.class);
    private static final DatasetAdminServiceAsync datasetAdminService = GWT.create(DatasetAdminService.class);
    private static final ListStore<User> listStore = new ListStore<User>(userProperties.key());


    @Override
    public Widget asWidget() {
    // Create the column model
    ColumnConfig<User, String> userName = new ColumnConfig<User, String>(userProperties.userName(), 100, "User name");


    ColumnConfig<User, Integer> errorLoginCount = new ColumnConfig<User, Integer>(userProperties.errorLoginCount(), 100, "Error login count");
    errorLoginCount.setAlignment(HasHorizontalAlignment.ALIGN_CENTER);


    ColumnConfig<User, Boolean> locked = new ColumnConfig<User, Boolean>(userProperties.locked(), 100, "Locked");
    locked.setCell(new CheckboxCell());
    locked.setAlignment(HasHorizontalAlignment.ALIGN_CENTER);


    ColumnConfig<User, Boolean> forcePasswordChange = new ColumnConfig<User, Boolean>(userProperties.forcePasswordChange(), 100, "Force password change");
    forcePasswordChange.setCell(new CheckboxCell());
    forcePasswordChange.setAlignment(HasHorizontalAlignment.ALIGN_CENTER);


    ColumnConfig<User, Date> lastLoginDate = new ColumnConfig<User, Date>(userProperties.lastLoginDate(), 100, "Last login date");
    lastLoginDate.setCell(new DateCell(DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_TIME_MEDIUM)));


    ColumnConfig<User, Date> createdOn = new ColumnConfig<User, Date>(userProperties.createdOn(), 100, "Created on");
    createdOn.setCell(new DateCell(DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_TIME_MEDIUM)));


    List<ColumnConfig<User, ?>> columns = new ArrayList<ColumnConfig<User, ?>>();
    columns.add(userName);
    columns.add(errorLoginCount);
    columns.add(locked);
    columns.add(forcePasswordChange);
    columns.add(lastLoginDate);
    columns.add(createdOn);


    ColumnModel<User> columnModel = new ColumnModel<User>(columns);


    // Create the grid
    Grid<User> userGrid = new Grid<User>(listStore, columnModel);
    userGrid.setHeight(400);
    userGrid.getView().setStripeRows(true);
    userGrid.getView().setColumnLines(true);


    return userGrid;
    }


    public void setDataset(Dataset dataset) {
    // Get the list of users from the service
    datasetAdminService.getUsers(dataset, new AsyncCallback<Collection<User>>() {
    @Override
    public void onFailure(Throwable caught) {
    AlertMessageBox alert = new AlertMessageBox("Store Error", caught.toString());
    alert.show();
    }


    @Override
    public void onSuccess(Collection<User> result) {
    listStore.clear();
    listStore.addAll(result);
    }
    });
    }
    }

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Answers
    109
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    You are missing the reset.css file - please add it to your html page as described in the setup.txt file.

    You should specify a width on that grid, or else it may not render correctly. Or, if being added to a parent container that will size it, setting a height is not necessary.

    Please follow the bug report guidelines for future issues - you are missing at least the DatasetAdminService, IUser and, User classes, as well as any entrypoint (there are tabs in your screenshot, but no tabs in your code).

    Moved to Q/A for any further discussion.

  3. #3
    Sencha User
    Join Date
    Mar 2013
    Posts
    26
    Vote Rating
    0
    phickey is on a distinguished road

      0  

    Default


    Thanks. It is working now

Thread Participants: 1

Tags for this Thread