Success! Looks like we've fixed this one. According to our records the fix was applied for a bug in our system in a recent build.
  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    10
    Vote Rating
    0
    Jarema Antosz is on a distinguished road

      0  

    Default GroupSummaryView with GridRowEditing

    GroupSummaryView with GridRowEditing


    Hi,
    I have widget with GroupSummaryView grid and GridRowEditing on this grid. After upgrade to version 3.0.0-rc when I add new row using editor on grid the grid's scroll bar and bottom of the grid hides unders widget borders. It looks like a bug in this version.

  2. #2
    Sencha User WesleyMoy's Avatar
    Join Date
    Oct 2009
    Location
    Redwood City, California
    Posts
    402
    Vote Rating
    2
    WesleyMoy is on a distinguished road

      0  

    Default


    I'd be interested in taking a look at this issue in more detail. Please post your test case (preferably implementing EntryPoint) and which browser you're using.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    10
    Vote Rating
    0
    Jarema Antosz is on a distinguished road

      0  

    Default


    Source code of my widget:
    Code:
    package pl.mycompany.sow.client.dwt.view;
    
    /**
     * @author a.jarema
     */
    import java.text.ParseException;
    import java.util.ArrayList;
    import java.util.List;
    
    import pl.mycompany.sow.client.messages.AppMessages;
    import pl.mycompany.sow.shared.domain.config.PhoneEmailStatus;
    import pl.mycompany.sow.shared.domain.config.PhoneType;
    import pl.mycompany.sow.shared.domain.customer.Phone;
    import pl.mycompany.sow.shared.domain.properties.PhoneProperties;
    
    import com.google.gwt.core.client.GWT;
    import com.google.gwt.core.client.Scheduler;
    import com.google.gwt.core.client.Scheduler.ScheduledCommand;
    import com.google.gwt.safehtml.shared.SafeHtml;
    import com.google.gwt.safehtml.shared.SafeHtmlUtils;
    import com.google.gwt.text.shared.AbstractSafeHtmlRenderer;
    import com.google.gwt.user.client.ui.Widget;
    import com.sencha.gxt.cell.core.client.SimpleSafeHtmlCell;
    import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
    import com.sencha.gxt.data.shared.Converter;
    import com.sencha.gxt.data.shared.LabelProvider;
    import com.sencha.gxt.data.shared.ListStore;
    import com.sencha.gxt.data.shared.ModelKeyProvider;
    import com.sencha.gxt.widget.core.client.button.TextButton;
    import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
    import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
    import com.sencha.gxt.widget.core.client.event.BeforeStartEditEvent;
    import com.sencha.gxt.widget.core.client.event.BeforeStartEditEvent.BeforeStartEditHandler;
    import com.sencha.gxt.widget.core.client.form.CheckBox;
    import com.sencha.gxt.widget.core.client.form.ComboBox;
    import com.sencha.gxt.widget.core.client.form.PropertyEditor;
    import com.sencha.gxt.widget.core.client.form.TextField;
    import com.sencha.gxt.widget.core.client.form.validator.RegExValidator;
    import com.sencha.gxt.widget.core.client.grid.CellSelectionModel;
    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 com.sencha.gxt.widget.core.client.grid.GroupSummaryView;
    import com.sencha.gxt.widget.core.client.grid.SummaryColumnConfig;
    import com.sencha.gxt.widget.core.client.grid.editing.ClicksToEdit;
    import com.sencha.gxt.widget.core.client.grid.editing.GridRowEditing;
    import com.sencha.gxt.widget.core.client.grid.editing.GridRowEditing.RowEditorMessages;
    import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
    
    public class CustomerPhonesWidget implements ICustomerPhonesWidget {
        
        private static final AppMessages APP_MESSAGES = GWT
                .create(AppMessages.class);
        
        private static final PhoneProperties phoneProps = GWT.create(PhoneProperties.class);
        
        private VerticalLayoutContainer container;
        
        private Grid<Phone> phoneGrid;
        
        private TextButton addPhoneButton;
        
        private TextButton showSkipPhonesButton;
        
        private TextButton refreshPhonesButton;
        
        final SummaryColumnConfig<Phone, String> statusCol;
        
        private GridRowEditing<Phone> phoneRowEditing;
        
        final GroupSummaryView<Phone> groupingView;
        
        ListStore<PhoneType> phoneTypeStore;
        
        ListStore<PhoneEmailStatus> phoneEmailStatusStore;
        
        private SkipPhonesWindow skipPhonesWindow;
        
        public CustomerPhonesWidget(){
            
            
            
            SummaryColumnConfig<Phone, String> phoneCol = new SummaryColumnConfig<Phone, String>(phoneProps.phone(), 100, "Telefon");
            
            statusCol = new SummaryColumnConfig<Phone, String>(phoneProps.phoneEmailStatus(), 100, "Status");
            
            
            SummaryColumnConfig<Phone, String> typeCol = new SummaryColumnConfig<Phone, String>(phoneProps.phoneType(), 100, "Typ");
            SummaryColumnConfig<Phone, String> descCol = new SummaryColumnConfig<Phone, String>(phoneProps.description(), 100, "Opis");
            SummaryColumnConfig<Phone, String> originCol = new SummaryColumnConfig<Phone, String>(phoneProps.originOfData(), 100, "Pochodzenie");
            
            SummaryColumnConfig<Phone, Boolean> smsAgreementCol = new SummaryColumnConfig<Phone, Boolean>(phoneProps.phoneSmsAgreement(), 100, "Sms");
            smsAgreementCol.setCell(new SimpleSafeHtmlCell<Boolean>(new AbstractSafeHtmlRenderer<Boolean>() {
                  @Override
                  public SafeHtml render(Boolean object) {
                    return SafeHtmlUtils.fromString(object ? "TAK" : "NIE");
                  }
                }));
            
            List<ColumnConfig<Phone, ?>> columnConfig = new ArrayList<ColumnConfig<Phone, ?>>();
            
            columnConfig.add(statusCol);
            columnConfig.add(phoneCol);
          
            columnConfig.add(typeCol);
            columnConfig.add(descCol);
            columnConfig.add(originCol);
            columnConfig.add(smsAgreementCol);
            
            ColumnModel<Phone> cm = new ColumnModel<Phone>(columnConfig);
            
            ListStore<Phone> store = new ListStore<Phone>(phoneProps.key());
            
            phoneGrid = new Grid<Phone>(store, cm);
            phoneGrid.setBorders(false);
            phoneGrid.getView().setStripeRows(true);
            phoneGrid.getView().setColumnLines(true);
            phoneGrid.setSelectionModel(new CellSelectionModel<Phone>());
            phoneGrid.setAllowTextSelection(true);
            
            
            createRowEditing(phoneCol, descCol, smsAgreementCol, typeCol);
            
            
            container = new VerticalLayoutContainer();
            container.setBorders(true);
            
            ToolBar toolBar = new ToolBar();
            
            addPhoneButton = new TextButton("Dodaj telefon");
            toolBar.add(addPhoneButton);
            
            showSkipPhonesButton = new TextButton("Telefony Skip");
            toolBar.add(showSkipPhonesButton);
            
            refreshPhonesButton = new TextButton(APP_MESSAGES.m_RefreshTable_text());
            toolBar.add(refreshPhonesButton);
            
            groupingView = new GroupSummaryView<Phone>();
            groupingView.setShowGroupedColumn(true);
            groupingView.setForceFit(true);
            
            phoneGrid.setView(groupingView);
            phoneGrid.getView().setShowDirtyCells(false);
            
            container.add(toolBar, new VerticalLayoutData(1, -1));
            container.add(phoneGrid, new VerticalLayoutData(1, 1));
        }
        
        @Override
        public SkipPhonesWindow getSkipPhonesWindow(){
            if(skipPhonesWindow==null){
                skipPhonesWindow = new SkipPhonesWindow();
            }
            return skipPhonesWindow;
        }
    
        public void scheduleGrouping() {
            Scheduler.get().scheduleFinally(new ScheduledCommand() {
              @Override
              public void execute() {
                    groupingView.groupBy(statusCol);
              }
            });
        }
        
        public void refreshGroupingGrid(){
            groupingView.refresh(true);
        }
    
        private void createRowEditing(SummaryColumnConfig<Phone, String> phoneCol,
                SummaryColumnConfig<Phone, String> descCol,
                SummaryColumnConfig<Phone, Boolean> smsAgreementCol, SummaryColumnConfig<Phone, String> typeCol) {
            phoneRowEditing = new GridRowEditing<Phone>(phoneGrid);
            
            TextField phoneField = new TextField();
            phoneField.setAllowBlank(false);
            phoneField.addValidator(new RegExValidator("\\d{9}"));
            phoneRowEditing.addEditor(phoneCol, phoneField);
            phoneRowEditing.addEditor(descCol, new TextField());
            phoneRowEditing.addEditor(smsAgreementCol, new CheckBox());
            phoneRowEditing.setMessages(new RowEditorMessages() {
    
                @Override
                public String cancelText() {
                    return APP_MESSAGES.bCancel();
                }
    
                @Override
                public String dirtyText() {
                    return "";
                }
    
                @Override
                public String errorTipTitleText() {
                    return "";
                }
    
                @Override
                public String saveText() {
                    return APP_MESSAGES.m_SaveButton_text();
                }
            });
            
            createPhoneTypeEditor(typeCol);
            
            createPhoneEmailStatusEditor(typeCol);
            
            
    
            phoneRowEditing.setClicksToEdit(ClicksToEdit.TWO);
            phoneRowEditing.addBeforeStartEditHandler(new BeforeStartEditHandler<Phone>() {
    
                @Override
                public void onBeforeStartEdit(BeforeStartEditEvent<Phone> event) {
                    int row = event.getEditCell().getRow();
                    if(row == -1){
                        event.setCancelled(true);
                    }
                }
            });
            phoneRowEditing.setMonitorValid(true);
        }
    
        private void createPhoneEmailStatusEditor(
                SummaryColumnConfig<Phone, String> typeCol) {
            phoneEmailStatusStore = new ListStore<PhoneEmailStatus>(new ModelKeyProvider<PhoneEmailStatus>() {
                @Override
                public String getKey(PhoneEmailStatus item) {
                  return item.getPhoneEmailStatusId().toString();
                }
              });
            ComboBox<PhoneEmailStatus> statusCombo = new  ComboBox<PhoneEmailStatus>(phoneEmailStatusStore, new LabelProvider<PhoneEmailStatus>() {
    
                @Override
                public String getLabel(PhoneEmailStatus item) {
                    return item.getStatusName();
                }
            });
            statusCombo.setPropertyEditor(new PropertyEditor<PhoneEmailStatus>() {
                
                @Override
                public PhoneEmailStatus parse(CharSequence text) throws ParseException {
                    List<PhoneEmailStatus> list = phoneEmailStatusStore.getAll();
                    for(PhoneEmailStatus type: list){
                        if(type.getStatusName().equals(text)){
                            return type;
                        }
                    }
                    return null;
                }
                
                @Override
                public String render(PhoneEmailStatus object) {
                    return object.getStatusName();
                }
            });
            statusCombo.setForceSelection(true);
            statusCombo.setEditable(false);
            statusCombo.setTriggerAction(TriggerAction.ALL);
            statusCombo.setAllowBlank(false);
            
            phoneRowEditing.addEditor(statusCol, new Converter<String, PhoneEmailStatus>() {
    
                @Override
                public String convertFieldValue(PhoneEmailStatus object) {
                    return object.getStatusName();
                }
    
                @Override
                public PhoneEmailStatus convertModelValue(String object) {
                    List<PhoneEmailStatus> list = phoneEmailStatusStore.getAll();
                    for(PhoneEmailStatus type: list){
                        if(type.getStatusName().equals(object)){
                            return type;
                        }
                    }
                    return null;
                }
            }, statusCombo);
        }
    
        private void createPhoneTypeEditor(
                SummaryColumnConfig<Phone, String> typeCol) {
            phoneTypeStore = new ListStore<PhoneType>(new ModelKeyProvider<PhoneType>() {
                @Override
                public String getKey(PhoneType item) {
                  return item.getPhoneTypeId().toString();
                }
              });
            ComboBox<PhoneType> phoneTypeCombo = new ComboBox<PhoneType>(phoneTypeStore, new LabelProvider<PhoneType>() {
    
                @Override
                public String getLabel(PhoneType item) {
                    return item.getTypeName();
                }
            });
            
            phoneTypeCombo.setPropertyEditor(new PropertyEditor<PhoneType>() {
                
                @Override
                public PhoneType parse(CharSequence text) throws ParseException {
                    List<PhoneType> list = phoneTypeStore.getAll();
                    for(PhoneType type: list){
                        if(type.getTypeName().equals(text)){
                            return type;
                        }
                    }
                    return null;
                }
                
                @Override
                public String render(PhoneType object) {
                    return object.getTypeName();
                }
            });
    
            phoneTypeCombo.setForceSelection(true);
            phoneTypeCombo.setEditable(false);
            phoneTypeCombo.setTriggerAction(TriggerAction.ALL);
            phoneTypeCombo.setAllowBlank(false);
            
            phoneRowEditing.addEditor(typeCol, new Converter<String, PhoneType>() {
    
                @Override
                public String convertFieldValue(PhoneType object) {
                    return object.getTypeName();
                }
    
                @Override
                public PhoneType convertModelValue(String object) {
                    List<PhoneType> list = phoneTypeStore.getAll();
                    for(PhoneType type: list){
                        if(type.getTypeName().equals(object)){
                            return type;
                        }
                    }
                    return null;
                }
            }, phoneTypeCombo);
        }
        
        public Grid<Phone> getPhoneGrid() {
            return phoneGrid;
        }
        
        @Override
        public Widget asWidget() {
            return container;
        }
    
        public GridRowEditing<Phone> getPhoneRowEditing() {
            return phoneRowEditing;
        }
    
        public TextButton getAddPhoneButton() {
            return addPhoneButton;
        }
        
        public TextButton getShowSkipPhonesButton(){
            return showSkipPhonesButton;
        }
        
        public TextButton getRefreshPhonesButton(){
            return refreshPhonesButton;
        }
    
        public ListStore<PhoneType> getPhoneTypeStore() {
            return phoneTypeStore;
        }
        
        public ListStore<PhoneEmailStatus> getPhoneEmailStatusStore() {
            return phoneEmailStatusStore;
        }
    
        public GroupSummaryView<Phone> getGroupingView() {
            return groupingView;
        }
    
        public SummaryColumnConfig<Phone, String> getStatusCol() {
            return statusCol;
        }
    
    }
    On my view class this widget is in portlet on PortalLayoutContainer :

    Code:
           PortalLayoutContainer portal = new PortalLayoutContainer(3);
            
            portal.setColumnWidth(0, .25);
            portal.setColumnWidth(1, .75);
            
            Portlet customerPhonesPortlet = new Portlet();
            customerPhonesPortlet.setHeadingText("Telefon");
            customerPhonesPortlet.setHeight(180);
            customerPhonesPortlet.setResize(true);
            configPanel(customerPhonesPortlet);
            portal.add(customerPhonesPortlet, 1);

  4. #4
    Sencha User
    Join Date
    Mar 2012
    Posts
    10
    Vote Rating
    0
    Jarema Antosz is on a distinguished road

      0  

    Default


    Screen attached:

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    10
    Vote Rating
    0
    Jarema Antosz is on a distinguished road

      0  

    Default


    I found another bug:
    after edit when I change value on field which is used for grouping changed value is propagated to all rows in this group.

  6. #6
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    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


    Thanks again for reporting this issue. A fix has been made and committed to SVN, and will be available in the next release.

Thread Participants: 2