You found a bug! We've classified it as EXTJSIII-150 . 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
    Dec 2007
    Posts
    69
    Vote Rating
    0
    cblin is on a distinguished road

      0  

    Default Ext.Editor : revertInvalid == false : what is the expected behavior ?

    Ext.Editor : revertInvalid == false : what is the expected behavior ?


    As an example, take http://dev.sencha.com/deploy/ext-3.4...d/edit-grid.js

    modify the definition of the first column :
    Code:
    editor: {
        revertInvalid: false,
        field : new fm.TextField({
            allowBlank: false,
            maxLength: 20
        })
    }
    In the UI, try to input more than 20 chars : the editor logically marks the field invalid.
    What is not so logic to me is that when I press enter or tab, the invalid value is LOST despite the fact that I have revertInvalid == false.

    I dig into the extjs code, the incriminated code is located in Editor.js, in the completeEdit function :
    Code:
                        if(!this.field.isValid()){
                            if(this.revertInvalid !== false){
                                this.cancelEdit(remainVisible);
                            }
                            return;
                        }
    What is not logic is that if revertInvalid is false, then we do not complete but always do a return (i.e the value is lost).
    The correct code should be IMHO :
    Code:
                        if(!this.field.isValid()){
                            if(this.revertInvalid !== false){
                                this.cancelEdit(remainVisible);
                                return; //return only if we have canceled, otherwise proceed as if the value is valid
                            }
                        }
    As a reference, this is also happening on v4 : http://stackoverflow.com/questions/1...led-validation

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,470
    Vote Rating
    202
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


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

  3. #3
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    975
    Vote Rating
    110
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Here is a bug report for ExtJS 4.
    http://www.sencha.com/forum/showthread.php?248080
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

Thread Participants: 2