Results 1 to 4 of 4

Thread: GridInlineEditing Bug

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium Member
    Join Date
    Nov 2010
    Location
    Italy
    Posts
    10

    Default GridInlineEditing Bug

    Hello,
    I'm using gxt_3.0.6 and replicating the example you brought about GridInlineEditing, i notice that the reported bug is still there.
    Here is the example I used:

    Code:
    import java.io.Serializable;
    import java.util.ArrayList;
    import java.util.List;
    
    
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.core.client.GWT;
    import com.google.gwt.editor.client.Editor.Path;
    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.RootPanel;
    import com.google.gwt.user.client.ui.Widget;
    import com.sencha.gxt.cell.core.client.SimpleSafeHtmlCell;
    import com.sencha.gxt.core.client.ValueProvider;
    import com.sencha.gxt.data.shared.ListStore;
    import com.sencha.gxt.data.shared.ModelKeyProvider;
    import com.sencha.gxt.data.shared.PropertyAccess;
    import com.sencha.gxt.widget.core.client.FramedPanel;
    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.form.CheckBox;
    import com.sencha.gxt.widget.core.client.form.TextField;
    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.editing.GridEditing;
    import com.sencha.gxt.widget.core.client.grid.editing.GridInlineEditing;
    
    
    public class TestApplicationGXT implements EntryPoint {
    
    
        public class FormatoVO implements Serializable {
            private static final long serialVersionUID = 1L;
    
    
            private String idformato;        
            private Boolean active;        
            private String descrizione;
            
            public String getIdformato() {
                return idformato;
            }
            
            public void setIdformato(String idformato) {
                this.idformato = idformato;
            }
            
            public Boolean getActive() {
                return active;
            }
            
            public void setActive(Boolean active) {
                this.active = active;
            }
            
            public String getDescrizione() {
                return descrizione;
            }
            
            public void setDescrizione(String descrizione) {
                this.descrizione = descrizione;
            }        
        }
    
    
        public interface IFormatoPropertiesAccess extends PropertyAccess<FormatoVO> {    
            @Path("idformato")
            ModelKeyProvider<FormatoVO> key();
            
            ValueProvider<FormatoVO, String> idformato();
            
            ValueProvider<FormatoVO, Boolean> active();    
            ValueProvider<FormatoVO, String> descrizione();    
        }
          
        IFormatoPropertiesAccess properties = GWT.create(IFormatoPropertiesAccess.class);
        protected Grid<FormatoVO> grid;
        
        public void onModuleLoad() {
            RootPanel.get().add(asWidget());
        }
    
    
        public Widget asWidget() {
            ColumnConfig<FormatoVO, String> cc1 = new ColumnConfig<FormatoVO, String>(properties.idformato(), 220, "Nome");
            ColumnConfig<FormatoVO, String> cc2 = new ColumnConfig<FormatoVO, String>(properties.descrizione(), 130, "Descrizione");
            ColumnConfig<FormatoVO, Boolean> cc3 = new ColumnConfig<FormatoVO, Boolean>(properties.active(), 55, "Attivo");
    
    
            AbstractSafeHtmlRenderer<Boolean> p = new AbstractSafeHtmlRenderer<Boolean>() {
                @Override
                public SafeHtml render(Boolean object) {
                    return SafeHtmlUtils.fromString(object ? "True" : "False");
                }
            };
    
    
            SimpleSafeHtmlCell<Boolean> s = new SimpleSafeHtmlCell<Boolean>(p);        
            cc3.setCell(s);
    
    
            List<ColumnConfig<FormatoVO, ?>> l = new ArrayList<ColumnConfig<FormatoVO, ?>>();
            l.add(cc1);
            l.add(cc2);        
            l.add(cc3);
    
    
            ColumnModel<FormatoVO> cm = new ColumnModel<FormatoVO>(l);
    
    
            final ListStore<FormatoVO> store = new ListStore<FormatoVO>(properties.key());
    
    
            List<FormatoVO> list = new ArrayList<FormatoVO>();
            FormatoVO item = null;
    
    
            item = new FormatoVO();
            item.setActive(true);
            item.setDescrizione("descrizione");
            item.setIdformato("idformato");
            list.add(item);
    
    
            item = new FormatoVO();
            item.setActive(true);
            item.setDescrizione("descrizione1");
            item.setIdformato("idformato1");
            list.add(item);
    
    
            store.addAll(list);
    
    
            grid = new Grid<FormatoVO>(store, cm);
            grid.getView().setAutoExpandColumn(cc1);
    
    
            // EDITING//
            final GridEditing<FormatoVO> editing = createGridEditing(grid);
            editing.addEditor(cc2, new TextField());
    
    
            CheckBox checkField = new CheckBox();
            editing.addEditor(cc3, checkField);
    
    
            FramedPanel cp = new FramedPanel();
            cp.setHeadingText("Editable Grid Example");
            cp.setPixelSize(600, 400);
            cp.addStyleName("margin-10");
    
    
            VerticalLayoutContainer con = new VerticalLayoutContainer();
            con.setBorders(true);        
            con.add(grid, new VerticalLayoutData(1, 1));
    
    
            cp.setWidget(con);    
    
    
            return cp;
        }
    
    
        protected GridEditing<FormatoVO> createGridEditing(Grid<FormatoVO> editableGrid) {
            return new GridInlineEditing<FormatoVO>(editableGrid);
        }
    }
    Where am I doing wrong?

  2. #2
    Sencha User
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737

    Default

    Which bug are you referring to? Several inline editing bugs have been filed and fixed in 3.0 and 3.1 nightly builds - have you tried either of those builds lately to see if they have resolved it?

  3. #3
    Ext GWT Premium Member
    Join Date
    Jun 2010
    Location
    Kyrksterra, Norway
    Posts
    71

    Default

    I assume this post refers to this bug:
    http://www.sencha.com/forum/showthre...-after-cliking

    I've run this code example against GXT 3.0.6, and can confirm that I see the same thing.

    1. Click inside the second column row one, and see that you are able to edit the content
    2. Click the last column in row one, and see that the editor is quickly shown, but then removed
    3. Click the second column in row two, and see that you are able to edit the content once more

    The rule is that you cannot edit something else within the same row as long as editing has been initiated for that row. Once you select an another row, editing works as expected for the first cell you select.

  4. #4
    Sencha Premium Member
    Join Date
    Nov 2010
    Location
    Italy
    Posts
    10

    Default

    Hello and thanks for the reply,
    I tried it with the version 3.1-20140224 (nightly builds) and it works!


    thanks
    Fabrizio

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •