You found a bug! We've classified it as EXTGWT-3006 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    25
    Vote Rating
    0
    phickey is on a distinguished road

      0  

    Default GridRowEditing displays the cells incorrectly

    GridRowEditing displays the cells incorrectly


    The GridRowEditing does not display the items in the grid correctly if you choose not to edit them.

    Here is the code for the GridRowEditing:

    Code:
    GridRowEditing<Region> gridRowEditing = new GridRowEditing<Region>(regionGrid);
    
    gridRowEditing.setClicksToEdit(ClicksToEdit.TWO); TextField regionNameEditor = new TextField(); MaxLengthValidator maxLengthValidator = new MaxLengthValidator(100); EmptyValidator<String> emptyValidatory = new EmptyValidator<String>(); regionNameEditor.addValidator(emptyValidatory); regionNameEditor.addValidator(maxLengthValidator); gridRowEditing.addEditor(columnConfigName, regionNameEditor);
    Here is the screen shot:
    Screen Shot 2013-04-15 at 10.18.52 AM.jpg

    I am using GXT 3.0.1. The screen shot shows the date column displaying incorrectly. Has this bee addressed in a later release (If so how to I download the evaluation version?). Please note I do not want to make the date column editable in anyway.

    Regards
    Patrick

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,640
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    I don't recognize the issue as one we already have filed - can you provide a runnable sample (as per the bug report template) so we can reproduce this?

    At a guess, this is specific to Date - it is rendering differently in the row editing than in the regular cell, which may be a bug in GXT or may be a quirk of your configuration - I'd need to see more to know for certain.

    As far as I am aware, the support releases are only available to support customers - you might try contacting sales to see if they could make an exception, but I don't know the policy on evaluations of support. The 'evaluation' copy on the downloads page is of the commercially licensed version, which just means the public version, but not covered under the GPL. Support is something different, allowing you support tickets, access to SVN, nightly builds, and other bugfix releases.

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    279
    Vote Rating
    9
    branflake2267 will become famous soon enough

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

    I've confirmed the issue exists in 3.0.4.

    We will update the thread once we make some progress on it.

    Thanks for reporting,
    Brandon

  4. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,640
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    Might be backpedaling on this issue - phickey, can you share your use case?

    The basic problem here is that the ColumnConfig was given a custom Cell with which to render the default date. Then, the GridRowEditing was told to *not* allow this column to be editable. The problem is the it doesn't make sense for any editor to draw that same Cell, since the Cell might be used for editing (see http://www.sencha.com/examples/#ExamplePlace:cellgrid as an example).

    It sounds like what you want is to draw *plain text* for that column, in the regular cell the same as in the grid row editor. The 'correct' way to do this would be to feed the grid editing a Converter object which can define how to turn that Date object into text:

    Code:
    gridRowEditing.addEditor(date, dateToStringConverter, null);
    where the dateToStringConverter is a Converter<Date, String> that invokes the same formatter as you gave to the DateCell in your column config. The problem with this is that the grid editing code will not accept a null for the last arguement.

    If I'm correct in this, then we should probably add a new method to AbstractGridEditing, something like setConverter(ColumnConfig,Converter) to clear this issue up. Cna you confirm that you have a custom cell set?

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

      0  

    Default Cell format should be the default render in the GridRowEditing class

    Cell format should be the default render in the GridRowEditing class


    Hi guys,

    Thanks for the reply. I think adding the mentioned method would be a good way to be able to do this, but I also think that the details for the grid should be reused by the editor for "display only" fields. The grid has already been given the configuration used to display the data, it would be a good enhancement to include this in the next versions.

    I have included the configuration for my column model here:

    Code:
    @UiFactory
        protected ColumnModel<Region> createColumnModel() {
            // Create the column model
            ColumnConfig<Region, Integer> id = new ColumnConfig<Region, Integer>(regionModel.id(), 100, messages.regionIdLabel());
    
    
            ColumnConfig<Region, Region.RegionType> type = new ColumnConfig<Region, Region.RegionType>(regionModel.regionType(), 150, messages.regionTypeLabel());
            type.setCell(new PropertyDisplayCell<Region.RegionType>(new PropertyEditor<Region.RegionType>() {
                @Override
                public Region.RegionType parse(CharSequence text) throws ParseException {
                    if (text.equals(messages.regionTypeText(Region.RegionType.USER_ASSIGNMENT))) {
                        return Region.RegionType.USER_ASSIGNMENT;
                    } else {
                        return Region.RegionType.LEAD_ASSIGNMENT;
                    }
                }
    
    
                @Override
                public String render(Region.RegionType regionType) {
                    return messages.regionTypeText(regionType);
                }
            }));
    
    
            columnConfigName = new ColumnConfig<Region, String>(regionModel.description(), 500, messages.regionDescriptionLabel());
            ColumnConfig<Region, Date> createdOn = new ColumnConfig<Region, Date>(regionModel.createdOn(), 100, messages.createdOnLabel());
            createdOn.setCell(new com.google.gwt.cell.client.DateCell(DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_TIME_SHORT)));
    
    
            List<ColumnConfig<Region, ?>> columns = new ArrayList<ColumnConfig<Region, ?>>();
            columns.add(id);
            columns.add(type);
            columns.add(columnConfigName);
            columns.add(createdOn);
    
    
            return new ColumnModel<Region>(columns);
        }
    The date cell has the format defined. I realize this might be a bigger change than you would like, or maybe more in-depth than the following:

    I copied the GridRowEditing class and made the following change (Ultimately it might be more involved than this go get the GridRowEditing class to display the label like the cell displays in the grid):

    Code:
    @SuppressWarnings("unchecked")
        protected <N, O> Widget doStartEditing(ColumnConfig<M, N> c, 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());
    
    
                //======================================
                // My changes
                if (c.getCell() != null) {
                    // If there is a cell defined use it to render the label text
                    SafeHtmlBuilder sb = new SafeHtmlBuilder();
                    c.getCell().render(null, colValue, sb);
                    l.setText(sb.toSafeHtml().asString());
                } else if (convertedValue != null) {
                    // Get the toString value of the converted value
                    l.setText(convertedValue.toString());
                }
                //=======================================
    
    
                return l;
            }
        }
    I hope this clarifies my situation. If you guys need more input or if you need more info let me know and I'll see what I can add, please note there may be alternate ways to do this, so treat this as an enhancement request?

    Thanks
    Patrick

  6. #6
    Ext GWT Premium Member
    Join Date
    Oct 2011
    Posts
    99
    Vote Rating
    0
    LEWJO10@ca.com is on a distinguished road

      0  

    Default


    I am glad to see that this issue is being worked on.

    I think Patrick’s suggestion that the details for the grid should be reused by the editor for "display only" fields is a very good one.

    If we must follow the approach of adding "display only" fields to GridRowEditing so as to specify appropriate formatting for dates, images, etc, then there is a second problem we will run into.

    GridRowEditing will set focus on the editable column that the user has clicked on and this may be a "display only" column that was added to GridRowEditing for formatting purposes only.

    When the user clicks on such a column, IE9 will throw a javascript error or attempting to set focus on a non-input element.

    Here is the error I got.

    (TypeError): Unable to get value of the property 'firstChild': object is null or undefined description: Unable to get value of the property 'firstChild': object is null or undefined number: -2146823281

    What we really need is a way to specify formatting for "display only" fields to GridRowEditing. If we can’t use Patrick’s suggestion, then we need a special method. Further, GridRowEditing should not try to give focus to a "display only" field.

    Thanks,
    John L.

  7. #7
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,640
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    Thanks John, that may make this more important, or perhaps the focus call is messed up for that widget. Which read-only field are you using? As of GXT 3.0.5, Component.focus uses a GWT class that traps any exception when trying to focus the underlying focus element in the IE browsers with this issue (in other words, all of them). Can you clarify which version you are using and which widget is seeing that issue?

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar