Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTGWT-2084 in 3.1.
  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    4
    Vote Rating
    0
    Jan Schoubo is on a distinguished road

      0  

    Default Delete or Remove Row in GridRowEditing

    Delete or Remove Row in GridRowEditing


    Hi,

    I sorely miss a "Delete" / "Remove" button next to the "Cancel" and "Save" presented when you click on a row in a GridRowEditing grid. The "Delete" button should remove the row and the record associated with it...

    I have looked in the code for GridRowEditing and tried to override part of it as shown below. However, my deleteBtn does not show up? My next step would be a new implementation of GridRowEditing, but being new to Ext GWT I thought I should ask before going down that path :-)

    Any suggestions will be much appreciated.

    - Jan

    Code:
    import com.google.gwt.cell.client.Cell.Context;
    import com.google.gwt.core.client.GWT;
    import com.sencha.gxt.data.shared.ListStore;
    import com.sencha.gxt.widget.core.client.button.*;
    import com.sencha.gxt.widget.core.client.event.*;
    import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
    import com.sencha.gxt.widget.core.client.grid.Grid;
    import com.sencha.gxt.widget.core.client.grid.editing.GridRowEditing;
    
    public class GridRowEditing2<T> extends GridRowEditing<T>
    {
      protected class RowEditorComponent2 extends RowEditorComponent {
    
        private TextButton deleteBtn;
    
        public RowEditorComponent2() {
          this(GWT.<RowEditorAppearance> create(RowEditorAppearance.class));
        }
    
        public RowEditorComponent2(final RowEditorAppearance appearance) {
          super(appearance);
    
          // There is not getButtonBar in RowEditorComponent... 
          ButtonBar buttonBar = (ButtonBar)(getSaveButton().getParent());
    
          deleteBtn = new TextButton("Remove"); // TODO messages.xxxText()
          buttonBar.add(deleteBtn);
    
          // Makes no difference
          // deleteBtn.setVisible(true);
          // deleteBtn.setEnabled(true);
        }
    
        public TextButton getDeleteButton()
        {
          return deleteBtn;
        }
      }
    
      @Override
      protected RowEditorComponent createRowEditor() {
        RowEditorComponent2 rowEditor = new RowEditorComponent2();
        rowEditor.getSaveButton().addSelectHandler(new SelectHandler() {
    
          @Override
          public void onSelect(final SelectEvent event) {
            completeEditing();
    
          }
        });
    
        rowEditor.getCancelButton().addSelectHandler(new SelectHandler() {
    
          @Override
          public void onSelect(final SelectEvent event) {
            cancelEditing();
    
          }
        });
    
        rowEditor.getDeleteButton().addSelectHandler(new SelectHandler() {
    
          @Override
          public void onSelect(final SelectEvent event) {
    
            // TODO Is this the proper way to delete a row in the grid?
            Context ctx = event.getContext();
            int i = ctx.getIndex();
            ListStore<T> store = getEditableGrid().getStore();
            store.remove(i);
            store.commitChanges();
          }
        });
        return rowEditor;
      }
    
    
      public GridRowEditing2(final Grid<T> editableGrid)
      {
        super(editableGrid);
      }
    
    
    }

  2. #2
    Sencha User
    Join Date
    May 2012
    Posts
    4
    Vote Rating
    0
    Jan Schoubo is on a distinguished road

      0  

    Default Small progress

    Small progress


    Hm, it turns out that the Delete button is actually there. If I tab through all the fields in the row, the tab goes on to the Cancel and Save button - and the next tab reveals my Delete button (Cancel shifts out and Save to the left.)

    So now I have to figure out how to make the ButtonBar wider...

    Also the remove code does not work - it seems to remove one of the other rows...

  3. #3
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Take a look at the template used in RowEditorDefaultAppearance. Its hardcoded. I will move the threads into the bugs forum.

  4. #4
    Sencha User
    Join Date
    May 2012
    Posts
    4
    Vote Rating
    0
    Jan Schoubo is on a distinguished road

      0  

    Default


    Thanks Sven,

    I'll have a look at the hardcoded implementation.

    In the meantime I have found a working piece of code for actually removing the row/record from the store when the elusive Delete button is pressed.

    I ended up making a copy of GridRowEditing and adding the Delete button to this.
    I'll be happy to post the whole code when I have come to the buttom of this - I really think a Grid should have option to include a Delete button as a standard functionality. In the meantime here is the Delete handler (add after the two similar handlers in createRowEditor):

    - Jan

    Code:
        rowEditor.getDeleteButton().addSelectHandler(new SelectHandler() {
    
          @Override
          public void onSelect(final SelectEvent event)
          {
            if (activeCell != null)
            {
              ListStore<M> store = getEditableGrid().getStore();
    
              int i = activeCell.getRow();
              store.remove(i);
              store.commitChanges();
    
              cancelEditing();
            }
          }
        });

  5. #5
    Sencha User
    Join Date
    May 2012
    Posts
    4
    Vote Rating
    0
    Jan Schoubo is on a distinguished road

      0  

    Default Success

    Success


    I followed Sven's advice and managed to create a new GridRowEditing3 that does what I want. Feel free to use in any way you see fit. Also, please let me know if there is a better way to do it - I started using GXT only four days ago, so I am still guessing... but I am actually quite proud of my accomplishment - thanx Sven :-)

    - Jan

    GridRowEditing3.java:
    Code:
    package dk.schoubo.android.couponserver.client.sencha;
    
    import java.util.logging.Logger;
    
    import com.google.gwt.core.client.*;
    import com.google.gwt.core.client.Scheduler.ScheduledCommand;
    import com.google.gwt.dom.client.NativeEvent;
    import com.google.gwt.event.dom.client.ScrollEvent;
    import com.google.gwt.event.logical.shared.*;
    import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
    import com.google.gwt.user.client.*;
    import com.google.gwt.user.client.ui.*;
    import com.sencha.gxt.core.client.*;
    import com.sencha.gxt.core.client.dom.*;
    import com.sencha.gxt.core.client.util.*;
    import com.sencha.gxt.data.shared.*;
    import com.sencha.gxt.messages.client.DefaultMessages;
    import com.sencha.gxt.widget.core.client.*;
    import com.sencha.gxt.widget.core.client.button.*;
    import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
    import com.sencha.gxt.widget.core.client.container.*;
    import com.sencha.gxt.widget.core.client.event.*;
    import com.sencha.gxt.widget.core.client.event.BodyScrollEvent.BodyScrollHandler;
    import com.sencha.gxt.widget.core.client.event.ColumnWidthChangeEvent.ColumnWidthChangeHandler;
    import com.sencha.gxt.widget.core.client.event.RefreshEvent.RefreshHandler;
    import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
    import com.sencha.gxt.widget.core.client.form.*;
    import com.sencha.gxt.widget.core.client.grid.*;
    import com.sencha.gxt.widget.core.client.grid.ColumnHiddenChangeEvent.ColumnHiddenChangeHandler;
    import com.sencha.gxt.widget.core.client.grid.Grid.GridCell;
    import com.sencha.gxt.widget.core.client.grid.Grid;
    import com.sencha.gxt.widget.core.client.grid.editing.*;
    import com.sencha.gxt.widget.core.client.grid.editing.GridRowEditing.RowEditorAppearance;
    
    /**
     * Displays an editor for all cells in a row and allows all fields in row to be
     * edited at the same time.
     *
     * @param <M> the model type
     */
    public class GridRowEditing3<M> extends AbstractGridEditing<M> {
    
      public class DefaultRowEditorMessages implements RowEditorMessages {
    
        @Override
        public String cancelText() {
          return DefaultMessages.getMessages().rowEditor_cancelText();
        }
    
        @Override
        public String dirtyText() {
          return DefaultMessages.getMessages().rowEditor_dirtyText();
        }
    
        @Override
        public String errorTipTitleText() {
          return DefaultMessages.getMessages().rowEditor_tipTitleText();
        }
    
        @Override
        public String saveText() {
          return DefaultMessages.getMessages().rowEditor_saveText();
        }
    
      }
    
      // If using this, it results in
      // 10:57:55.882 [ERROR] [webcoupon] Deferred binding result type 'dk.schoubo.android.couponserver.client.GridRowEditing3.RowEditorAppearance' should not be abstract
      // If commented out, and using the one in the original GridRowEditing, it works...
    
      //  public interface RowEditorAppearance {
      //    XElement getButtonWrap(XElement parent);
      //
      //    XElement getContentWrap(XElement parent);
      //
      //    String labelClass();
      //
      //    void render(SafeHtmlBuilder sb);
      //  }
    
      public interface RowEditorMessages {
        String cancelText();
    
        String dirtyText();
    
        String errorTipTitleText();
    
        String saveText();
      }
    
      protected class Handler extends AbstractGridEditing<M>.Handler implements ColumnWidthChangeHandler,
      ColumnHiddenChangeHandler, ResizeHandler, BodyScrollHandler, RefreshHandler {
    
        @Override
        public void onBodyScroll(final BodyScrollEvent event) {
          positionButtons();
        }
    
        @Override
        public void onColumnHiddenChange(final ColumnHiddenChangeEvent event) {
          cancelEditing();
        }
    
        @Override
        public void onColumnWidthChange(final ColumnWidthChangeEvent event) {
          verifyLayout();
    
        }
    
        @Override
        public void onRefresh(final RefreshEvent event) {
          cancelEditing();
        }
    
        @Override
        public void onResize(final ResizeEvent event) {
          verifyLayout();
        }
    
      }
    
      protected class RowEditorComponent extends Component {
    
        private final RowEditorAppearance appearance;
        private ButtonBar buttonBar;
        private TextButton cancelBtn, saveBtn, deleteBtn;
        private HBoxLayoutContainer con;
    
        public RowEditorComponent() {
          this(GWT.<RowEditorAppearance> create(RowEditorAppearance3Button.class));
        }
    
        public RowEditorComponent(final RowEditorAppearance appearance) {
          this.appearance = appearance;
    
          SafeHtmlBuilder sb = new SafeHtmlBuilder();
          appearance.render(sb);
    
          setElement(XDOM.create(sb.toSafeHtml()));
    
          con = new HBoxLayoutContainer();
          con.setEnableOverflow(false);
          appearance.getContentWrap(getElement()).appendChild(con.getElement());
    
          buttonBar = new ButtonBar();
          buttonBar.setEnableOverflow(false);
          buttonBar.setHorizontalSpacing(4);
          buttonBar.setVerticalSpacing(1);
          appearance.getButtonWrap(getElement()).appendChild(buttonBar.getElement());
    
          cancelBtn = new TextButton(messages.cancelText());
          buttonBar.add(cancelBtn);
    
          saveBtn = new TextButton(messages.saveText());
          buttonBar.add(saveBtn);
    
          //      System.out.println("Adding Delete button in "+GridRowEditing3.class.getName());
    
          deleteBtn = new TextButton("Delete"); // TODO messages.xxxText()
          buttonBar.add(deleteBtn);
    
          sinkEvents(Event.ONMOUSEDOWN);
        }
    
        /**
         * Returns the row editor appearance.
         *
         * @return the appearance
         */
        public RowEditorAppearance getAppearance() {
          return appearance;
        }
    
        /**
         * Returns the cancel button.
         *
         * @return the cancel button
         */
        public TextButton getCancelButton() {
          return cancelBtn;
        }
    
        /**
         * Returns the delete button.
         *
         * @return the delete button
         */
        public TextButton getDeleteButton() {
          return deleteBtn;
        }
    
        /**
         * Returns the field container.
         *
         * @return the field container
         */
        public HBoxLayoutContainer getFieldContainer() {
          return con;
        }
    
        /**
         * Returns the button container.
         *
         * @return the button container
         */
        public ButtonBar getButtonContainer() {
          return buttonBar;
        }
    
        /**
         * Returns the save button.
         *
         * @return the save button
         */
        public TextButton getSaveButton() {
          return saveBtn;
        }
    
        @Override
        public void onBrowserEvent(final Event event) {
          super.onBrowserEvent(event);
          if (event.getTypeInt() == Event.ONMOUSEDOWN) {
            // stop the mouse down to bubble to grid
            event.stopPropagation();
          }
        }
    
        @Override
        protected void doAttachChildren() {
          super.doAttachChildren();
          ComponentHelper.doAttach(buttonBar);
          ComponentHelper.doAttach(con);
        }
    
        @Override
        protected void doDetachChildren() {
          super.doDetachChildren();
          ComponentHelper.doDetach(buttonBar);
          ComponentHelper.doDetach(con);
        }
    
      }
    
      protected boolean bound;
      protected boolean lastValid;
      protected RowEditorMessages messages = new DefaultRowEditorMessages();
      protected Timer monitorTimer;
    
      private int monitorPoll = 200;
      private boolean monitorValid = true;
      private final RowEditorComponent rowEditor;
    
      private static Logger logger = Logger.getLogger(GridRowEditing3.class.getName());
    
      /**
       * Creates a new row editing instance.
       *
       * @param editableGrid the target grid
       */
      public GridRowEditing3(final Grid<M> editableGrid) {
        setEditableGrid(editableGrid);
    
        rowEditor = createRowEditor();
      }
    
      @Override
      public void cancelEditing() {
        if (activeCell != null) {
          final GridCell editCell = activeCell;
          removeEditor();
          fireEvent(new CancelEditEvent<M>(editCell));
        }
      }
    
      @Override
      public void completeEditing() {
        if (activeCell != null) {
          if (GXTLogConfiguration.loggingIsEnabled()) {
            logger.finest("completeEditing activeCell not null");
          }
          for (int i = 0, len = columnModel.getColumnCount(); i < len; i++) {
            ColumnConfig<M, ?> c = columnModel.getColumn(i);
            doCompleteEditing(c);
          }
          final GridCell editCell = activeCell;
          removeEditor();
          fireEvent(new CompleteEditEvent<M>(editCell));
        }
      }
    
      /**
       * Returns the row editor messages.
       *
       * @return the messages
       */
      public RowEditorMessages getMessages() {
        return messages;
      }
    
      /**
       * Returns the interval that the row editor is validated.
       *
       * @return the interval in ms
       */
      public int getMonitorPoll() {
        return monitorPoll;
      }
    
      @Override
      public void setEditableGrid(final Grid<M> editableGrid) {
        super.setEditableGrid(editableGrid);
        if (editableGrid != null) {
          groupRegistration.add(columnModel.addColumnHiddenChangeHandler(ensureInternHandler()));
          groupRegistration.add(columnModel.addColumnWidthChangeHandler(ensureInternHandler()));
          groupRegistration.add(editableGrid.addRefreshHandler(ensureInternHandler()));
          groupRegistration.add(editableGrid.addResizeHandler(ensureInternHandler()));
          groupRegistration.add(editableGrid.addBodyScrollHandler(ensureInternHandler()));
        }
      }
    
      /**
       * Sets the row editor messages.
       *
       * @param messages the messages
       */
      public void setMessages(final RowEditorMessages messages) {
        this.messages = messages;
    
        rowEditor.getCancelButton().setText(messages.cancelText());
        rowEditor.getSaveButton().setText(messages.saveText());
        rowEditor.getDeleteButton().setText("Delete");
      }
    
      /**
       * Sets the polling interval that the row editor validation is run (defaults
       * to 200).
       *
       * @param monitorPoll the polling interval in ms in that validation is done
       */
      public void setMonitorPoll(final int monitorPoll) {
        this.monitorPoll = monitorPoll;
      }
    
      /**
       * True to monitor the valid status of this row editor (defaults to true).
       *
       * @param monitorValid true to monitor this row editor
       */
      public void setMonitorValid(final boolean monitorValid) {
        this.monitorValid = monitorValid;
      }
    
      @Override
      public void startEditing(final GridCell cell) {
        if (getEditableGrid() != null && getEditableGrid().isAttached() && cell != null) {
          BeforeStartEditEvent<M> ce = new BeforeStartEditEvent<M>(cell);
          fireEvent(ce);
          if (ce.isCancelled()) {
            return;
          }
          cancelEditing();
          M value = getEditableGrid().getStore().get(cell.getRow());
    
          if (GXTLogConfiguration.loggingIsEnabled()) {
            logger.finest("startEditing cell = " + cell + " start value = " + value);
          }
    
          activeCell = cell;
          getEditableGrid().getView().getEditorParent().appendChild(rowEditor.getElement());
          ComponentHelper.doAttach(rowEditor);
    
          Container con = rowEditor.getFieldContainer();
          con.clear();
    
          int adj = 1;
          for (int i = 0, len = columnModel.getColumnCount(); i < len; i++) {
            ColumnConfig<M, ?> c = columnModel.getColumn(i);
    
            final Widget w = doStartEditing(c, value);
            if (w != null) {
              BoxLayoutData ld = new BoxLayoutData();
              ld.setMargins(new Margins(1, 2, 2, 2 + adj));
              w.setLayoutData(ld);
              con.add(w);
              adj = 0;
            }
          }
    
          Point p = XElement.as(getEditableGrid().getView().getRow(cell.getRow())).getXY();
          rowEditor.setPagePosition(p.getX(), p.getY());
    
          verifyLayout();
    
          startMonitoring();
          focusField(activeCell);
          fireEvent(new StartEditEvent<M>(activeCell));
        }
      }
    
      protected void bindHandler() {
        boolean valid = isValid();
        if (!valid) {
          lastValid = false;
        } else if (valid && !lastValid) {
          lastValid = true;
        }
    
        if (rowEditor.getSaveButton() != null) {
          rowEditor.getSaveButton().setEnabled(valid);
        }
      }
    
      protected RowEditorComponent createRowEditor() {
        RowEditorComponent rowEditor = new RowEditorComponent();
        rowEditor.getSaveButton().addSelectHandler(new SelectHandler() {
    
          @Override
          public void onSelect(final SelectEvent event) {
            completeEditing();
    
          }
        });
    
        rowEditor.getCancelButton().addSelectHandler(new SelectHandler() {
    
          @Override
          public void onSelect(final SelectEvent event) {
            cancelEditing();
    
          }
        });
    
        rowEditor.getDeleteButton().addSelectHandler(new SelectHandler() {
    
          @Override
          public void onSelect(final SelectEvent event)
          {
            if (activeCell != null)
            {
              ListStore<M> store = getEditableGrid().getStore();
    
              int i = activeCell.getRow();
              store.remove(i);
              store.commitChanges();
    
              cancelEditing();
            }
          }
        });
    
        return rowEditor;
      }
    
      @SuppressWarnings("unchecked")
      protected <N, O> void doCompleteEditing(final ColumnConfig<M, N> c) {
        if (activeCell != null) {
          Field<O> field = getEditor(c);
    
          if (field != null) {
            Converter<N, O> converter = getConverter(c);
    
            O fieldValue = field.getValue();
    
            N convertedValue;
            if (converter != null) {
              convertedValue = converter.convertFieldValue(fieldValue);
            } else {
              convertedValue = (N) fieldValue;
            }
    
            if (GXTLogConfiguration.loggingIsEnabled()) {
              logger.finest("doCompleteEditng convertedValue = " + convertedValue);
            }
    
            ListStore<M> store = getEditableGrid().getStore();
            ListStore<M>.Record r = store.getRecord(store.get(activeCell.getRow()));
            r.addChange(c.getValueProvider(), convertedValue);
          }
        }
      }
    
      @SuppressWarnings("unchecked")
      protected <N, O> Widget doStartEditing(final ColumnConfig<M, N> c, final M value) {
        if (c.isHidden()) {
          return null;
        }
    
        Field<O> f = getEditor(c);
    
        Converter<N, O> converter = getConverter(c);
    
        ValueProvider<? super M, N> v = c.getValueProvider();
        N colValue = getEditableGrid().getStore().hasRecord(value)
        ? getEditableGrid().getStore().getRecord(value).getValue(v) : v.getValue(value);
        O convertedValue;
        if (converter != null) {
          convertedValue = converter.convertModelValue(colValue);
        } else {
          convertedValue = (O) colValue;
        }
    
        if (GXTLogConfiguration.loggingIsEnabled()) {
          logger.finest("doStartEditing convertedValue = " + convertedValue);
        }
    
        if (f != null) {
          f.setValue(convertedValue);
          return f;
        } else {
          Label l = new Label();
          l.addStyleName(rowEditor.getAppearance().labelClass());
          l.setText(convertedValue != null ? convertedValue.toString() : "");
          return l;
        }
    
      }
    
      @SuppressWarnings("unchecked")
      @Override
      protected Handler ensureInternHandler() {
        if (handler == null) {
          handler = new Handler();
        }
        return (Handler) handler;
      }
    
      protected boolean isValid() {
        for (int i = 0, len = rowEditor.getFieldContainer().getWidgetCount(); i < len; i++) {
    
          Widget w = rowEditor.getFieldContainer().getWidget(i);
          if (w instanceof ValueBaseField<?>) {
            ValueBaseField<?> f = (ValueBaseField<?>) w;
            if (!f.isCurrentValid(true)) {
              return false;
            }
          } else if (w instanceof Field<?>) {
            Field<?> f = (Field<?>) w;
            if (!f.isValid(true)) {
              return false;
            }
          }
        }
        return true;
      }
    
      @Override
      protected void onEnter(final NativeEvent evt) {
        //
      }
    
      @Override
      protected void onScroll(final ScrollEvent event) {
        //
      }
    
      protected void positionButtons() {
        ButtonBar buttonBar = rowEditor.getButtonContainer();
    
        int sum = 0;
        for (int i = 0; i < buttonBar.getWidgetCount(); i++)
        {
          Widget w = buttonBar.getWidget(i);
          int width = w.getElement().getClientWidth();
          sum += width;
        }
        sum += (buttonBar.getWidgetCount() + 1) * buttonBar.getHorizontalSpacing();
    
        buttonBar.setWidth(sum);
    
        buttonBar.forceLayout();
     }
    
      protected void startMonitoring() {
        if (!bound && monitorValid) {
          bound = true;
          if (monitorTimer == null) {
            monitorTimer = new Timer() {
              @Override
              public void run() {
                bindHandler();
              }
            };
          }
          monitorTimer.scheduleRepeating(monitorPoll);
        }
      }
    
      protected void stopMonitoring() {
        bound = false;
        if (monitorTimer != null) {
          monitorTimer.cancel();
        }
      }
    
      protected void verifyLayout() {
        if (isEditing()) {
          // border both sides
          int adj = 2;
          rowEditor.setWidth(columnModel.getTotalWidth(false) + adj);
    
          for (int i = 0, j = 0, len = columnModel.getColumnCount(); i < len; i++) {
            ColumnConfig<M, ?> c = columnModel.getColumn(i);
            if (c.isHidden()) {
              continue;
            }
    
            Widget w = rowEditor.getFieldContainer().getWidget(j++);
            int width = c.getWidth();
    
            Object layoutData = w.getLayoutData();
            if (layoutData instanceof MarginData) {
              Margins m = ((MarginData) layoutData).getMargins();
              if (m != null) {
                width -= m.getLeft();
                width -= m.getRight();
              }
            }
            if (w instanceof Field<?>) {
    
              ((Field<?>) w).setWidth(width);
            } else {
              XElement.as(w.getElement()).setWidth(c.getWidth(), true);
            }
    
          }
          rowEditor.getFieldContainer().forceLayout();
          positionButtons();
        }
      }
    
      private void focusField(final GridCell activeCell) {
        Widget w = activeCell.getCol() < 0 || activeCell.getCol() > rowEditor.getFieldContainer().getWidgetCount() ? null
            : getEditor(columnModel.getColumn(activeCell.getCol()));
    
        if (!(w instanceof Field<?>)) {
          for (Widget widget : rowEditor.getFieldContainer()) {
            if (widget instanceof Field<?>) {
              w = widget;
              break;
            }
          }
        }
        if (w instanceof Field<?>) {
          final Field<?> field = (Field<?>) w;
          Scheduler.get().scheduleDeferred(new ScheduledCommand() {
            @Override
            public void execute() {
              if (isEditing()) {
                field.focus();
              }
            }
          });
        }
    
      }
    
      private void removeEditor() {
        stopMonitoring();
        activeCell = null;
        ComponentHelper.doDetach(rowEditor);
        rowEditor.getElement().removeFromParent();
        rowEditor.getFieldContainer().clear();
      }
    }
    RowEditorAppearance3Button.java:
    Code:
    package dk.schoubo.android.couponserver.client.sencha;
    
    import com.google.gwt.core.client.GWT;
    import com.google.gwt.resources.client.*;
    import com.google.gwt.resources.client.ImageResource.ImageOptions;
    import com.google.gwt.resources.client.ImageResource.RepeatStyle;
    import com.google.gwt.safehtml.shared.*;
    import com.sencha.gxt.core.client.XTemplates;
    import com.sencha.gxt.core.client.dom.XElement;
    import com.sencha.gxt.core.client.resources.StyleInjectorHelper;
    import com.sencha.gxt.widget.core.client.grid.editing.GridRowEditing.RowEditorAppearance;
    
    public class RowEditorAppearance3Button implements RowEditorAppearance {
    
      public interface RowEditorResources extends ClientBundle {
        @Source("RowEditor3.css")
        RowEditorStyle3 css();
    
        @ImageOptions(repeatStyle = RepeatStyle.None)
        ImageResource editorButtonLeft();
    
        @ImageOptions(repeatStyle = RepeatStyle.None)
        ImageResource editorButtonCenter();
    
        @ImageOptions(repeatStyle = RepeatStyle.None)
        ImageResource editorButtonRight();
    
        @ImageOptions(repeatStyle = RepeatStyle.Horizontal)
        ImageResource editorButtonBackground();
      }
    
      public interface RowEditorStyle3 extends CssResource {
        String editor();
    
        String outer();
    
        String inner();
    
        String body();
    
        String buttons();
    
        String buttonsLeft();
    
        String buttonsCenter();
    
        String buttonsRight();
    
        String buttonsContent();
    
        String label();
      }
    
      public interface Template extends XTemplates {
        @XTemplate(source = "RowEditor3.html")
        SafeHtml render(RowEditorStyle3 style);
      }
    
      private final RowEditorResources resources;
      private final RowEditorStyle3 style;
      protected Template template = GWT.create(Template.class);
    
      public RowEditorAppearance3Button() {
        this(GWT.<RowEditorResources> create(RowEditorResources.class));
      }
    
      public RowEditorAppearance3Button(final RowEditorResources resources) {
        this.resources = resources;
        this.style = resources.css();
        StyleInjectorHelper.ensureInjected(resources.css(), true);
      }
    
      @Override
      public void render(final SafeHtmlBuilder sb) {
        sb.append(template.render(resources.css()));
      }
    
      @Override
      public XElement getButtonWrap(final XElement parent) {
        return parent.selectNode("." + style.buttonsContent());
      }
    
      @Override
      public XElement getContentWrap(final XElement parent) {
        return parent.selectNode("." + style.body());
      }
    
      @Override
      public String labelClass() {
        return style.label();
      }
    
    }
    RowEditor3.css:
    Code:
    .editor {
      position: absolute;
    }
    
    .label {
      padding: 2px 3px 3px 0px;
      font-size: 12px;
    }
    
    .outer {
      border-top: 1px solid #c4c4c4;
      border-bottom: 1px solid #a0a0a0;
      background-color: #ebf2fc;
    
    }
    
    .inner {
      border-top: 1px solid #f6f9fe;
      border-bottom: 1px solid #d6e4f8;
      padding: 0px 0px 0px 0px;
    }
    
    .body {
      height: 25px;
      position: relative;
    }
    
    .buttons {
      position: absolute;
      top: 27px;
    }
    
    @sprite .buttonsLeft {
      gwt-image: 'editorButtonLeft';
      padding-left: value('editorButtonLeft.getWidth', 'px');
      zoom:1;
      height: 31px;
      width: auto;
    }
    
    @sprite .buttonsCenter {
      gwt-image: 'editorButtonCenter';
      zoom:1;
      height: auto;
      width: auto;
    }
    
    @sprite .buttonsRight {
      gwt-image: 'editorButtonRight';
      background-position: right 0;
      padding-right: value('editorButtonRight.getWidth', 'px');
      overflow: visible;
      width: auto;
      height: auto;
    }
    
    @sprite .buttonsContent {
      background-color: #ebf2fc;
      gwt-image: 'editorButtonBackground';
    }
    RowEditor3.html:
    Code:
    <div class="{style.editor}">
      <div class="{style.outer}">
        <div class="{style.inner}">
          <div class="{style.body}"></div>
        </div>
      </div>
      <div class="{style.buttons}" > <!--style="width: 200px;">-->
        <div class="{style.buttonsLeft}">
          <div class="{style.buttonsCenter}">
            <div class="{style.buttonsRight}">
              <div class="{style.buttonsContent}"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
    You also need to take a copy of the following three GIF files from gxt-3.0.0.jar from path com/sencha/gxt/theme/base/client/grid :

    editorButtonBackground.gif, editorButtonLeft.gif, editorButtonRight.gif


    (This last piece may not be neceesary?)
    Finally, you need to make editorButtonCenter.gif - I simply copied editorButtonLeft.gif .


    Put all of this in a subdirectory BELOW the one containing xxx.gwt.xml and use like GridRowEditor .
    Last edited by Jan Schoubo; 5 May 2012 at 4:05 AM. Reason: Better calculation of width of buttonBar

  6. #6
    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


    Thanks for your investigations. I'm filing this ticket against the team so we can follow up with the appropriate changes in the library. I'll update this thread with any changes we make.

  7. #7
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    203
    Vote Rating
    0
    vkeswani can only hope to improve

      0  

    Default


    Is this bug fixed or going to be fixed soon?

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


    This is in progress for 3.1 (as it involves API changes) - among a few other changes, the button bar will be more visible and will have options for configuring position.

    Does the user-provided workaround not work for you in the meantime?

  9. #9
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    203
    Vote Rating
    0
    vkeswani can only hope to improve

      0  

    Default


    Thanks Colin...should 3.1 be out soon? I can use the workaround in the mean-time. Thanks Vinita