1. #11
    Ext Premium Member
    Join Date
    Aug 2008
    Location
    San Rafael, CA
    Posts
    31
    Vote Rating
    0
    JGALFO is on a distinguished road

      0  

    Default


    Hi, I have a related issue that I need to resolve. I need to hide the input box on selected records. Could you please check my post? Thanks
    http://www.extjs.com/forum/showthrea...841#post358841

  2. #12
    Ext User
    Join Date
    Oct 2009
    Posts
    4
    Vote Rating
    0
    dilip.khichade is on a distinguished road

      0  

    Default not displaying validation text

    not displaying validation text


    This code does not display the validation text on mouse over.If I have given allowBlank:false,
    on mouse over it should display "This field is required".If I have regex,it should display regexText.One more thing its look and feel is not as great as default.

  3. #13
    Ext JS Premium Member
    Join Date
    Oct 2008
    Posts
    8
    Vote Rating
    0
    allenlako is on a distinguished road

      0  

    Default keep invalid data and highlight grid cell

    keep invalid data and highlight grid cell


    I had to come up with a similar solution to this problem because we found that if the invalid data was reverted back to the original value, the user would skip past it onto the next cell and never realize their change never happened. To remedy the issue, I came up with two overrides to keep the invalid data and also highlight the grid cell after edit.

    Code:
    // override to keep invalid data in cell and not revert to original
    Ext.override( Ext.Editor, {
        completeEdit : function(remainVisible){
            if(!this.editing){
                return;
            }
            var v = this.getValue();
            if(!this.field.isValid()){
                if(this.revertInvalid !== false){
                    //this.cancelEdit(remainVisible);
                }
                //return;
            }
            if(String(v) === String(this.startValue) && this.ignoreNoChange){
                this.hideEdit(remainVisible);
                return;
            }
            if(this.fireEvent("beforecomplete", this, v, this.startValue) !== false){
                v = this.getValue();
                if(this.updateEl && this.boundEl){
                    this.boundEl.update(v);
                }
                this.hideEdit(remainVisible);
                this.fireEvent("complete", this, v, this.startValue);
            }
    
        }
    });
    
    // override to mark invalid cells with highlight after done editing
    Ext.override(Ext.grid.EditorGridPanel,{
        onEditComplete : function(ed, value, startValue){
            this.editing = false;
            this.activeEditor = null;
            ed.un("specialkey", this.selModel.onEditorKey, this.selModel);
            var r = ed.record;
            var field = this.colModel.getDataIndex(ed.col);
            value = this.postEditValue(value, startValue, r, field);
            if(this.forceValidation === true || String(value) !== String(startValue)){
                var e = {
                    grid: this,
                    record: r,
                    field: field,
                    originalValue: startValue,
                    value: value,
                    row: ed.row,
                    column: ed.col,
                    cancel:false
                };
                if(this.fireEvent("validateedit", e) !== false && !e.cancel && String(value) !== String(startValue)){
                    r.set(field, e.value);
                    delete e.cancel;
                    this.fireEvent("afteredit", e);
                }
            }
            this.view.focusCell(ed.row, ed.col);
                if(!ed.field.isValid(true)){
                    var cell = this.getView().getCell(ed.row, ed.col);
                    cell = Ext.get(cell);
                    cell.addClass('x-form-invalid');
                }
        }
    })
    hope this helps.

  4. #14
    Ext User
    Join Date
    Nov 2009
    Location
    Cairns
    Posts
    1
    Vote Rating
    0
    Starlyjff is on a distinguished road

      0  

    Default


    Actually it is using ScriptTagProxy to get json data from server. I was sending pure json from server which is not the correct way. ScriptTagProxy sends a url parameter. DCOM Error : Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.. I was wondering how i could make EditorGridPanel readonly at runtime. Finally I managed to find out a way to do this. What.

  5. #15
    Ext User
    Join Date
    Aug 2007
    Posts
    32
    Vote Rating
    0
    Xouqoa is on a distinguished road

      0  

    Default


    @allenlako

    Thanks, exactly what I was looking for.

  6. #16
    Ext User
    Join Date
    Feb 2010
    Posts
    2
    Vote Rating
    0
    HENARRY JAYA is on a distinguished road

      0  

    Default Gretings, I m hanarry jaya

    Gretings, I m hanarry jaya


    Hello,

    Welcome....I am new to this forum and this is my first post, it feels great to be a part of a growing internet community.

    I would love to participate with nice tips and tricks I learned in my several years of online experimenting...

    Regards,

  7. #17
    Ext User
    Join Date
    Jan 2008
    Posts
    12
    Vote Rating
    0
    juanramoney is on a distinguished road

      0  

    Default


    Thanks allenlako, that code solved the problem.

  8. #18
    Ext User
    Join Date
    Jun 2010
    Posts
    2
    Vote Rating
    0
    timrei is on a distinguished road

      0  

    Default


    @allenlako: Good job! Thanks!

  9. #19
    Sencha User
    Join Date
    Nov 2010
    Posts
    80
    Vote Rating
    0
    mond is on a distinguished road

      0  

    Default


    How about the triggers is in a button. and the checking similar to this for loop code block.

    if (proceed == false){
    for(var j = 0; j<data2.length;j++){
    var value = data2[j];
    //alert(value);
    if(value == ""){
    proceed2 = true;
    if(Ext.isIE){
    messageBox('Kindly fill in all ratings for PART II.', Ext.MessageBox.ERROR);
    break;
    }else{
    messageBox('Kindly fill in all ratings for PART II.', Ext.MessageBox.ERROR);
    break;
    }
    }
    proceed2 = false;
    }// end loop
    }

  10. #20
    Sencha Premium Member dpaquin's Avatar
    Join Date
    Jul 2011
    Location
    Vancouver, Canada
    Posts
    31
    Vote Rating
    0
    dpaquin is on a distinguished road

      0  

    Default


    Quote Originally Posted by allenlako View Post
    I had to come up with a similar solution to this problem because we found that if the invalid data was reverted back to the original value, the user would skip past it onto the next cell and never realize their change never happened. To remedy the issue, I came up with two overrides to keep the invalid data and also highlight the grid cell after edit.

    Code:
    // override to keep invalid data in cell and not revert to original
    Ext.override( Ext.Editor, {
        completeEdit : function(remainVisible){
            if(!this.editing){
                return;
            }
            var v = this.getValue();
            if(!this.field.isValid()){
                if(this.revertInvalid !== false){
                    //this.cancelEdit(remainVisible);
                }
                //return;
            }
            if(String(v) === String(this.startValue) && this.ignoreNoChange){
                this.hideEdit(remainVisible);
                return;
            }
            if(this.fireEvent("beforecomplete", this, v, this.startValue) !== false){
                v = this.getValue();
                if(this.updateEl && this.boundEl){
                    this.boundEl.update(v);
                }
                this.hideEdit(remainVisible);
                this.fireEvent("complete", this, v, this.startValue);
            }
    
        }
    });
    
    // override to mark invalid cells with highlight after done editing
    Ext.override(Ext.grid.EditorGridPanel,{
        onEditComplete : function(ed, value, startValue){
            this.editing = false;
            this.activeEditor = null;
            ed.un("specialkey", this.selModel.onEditorKey, this.selModel);
            var r = ed.record;
            var field = this.colModel.getDataIndex(ed.col);
            value = this.postEditValue(value, startValue, r, field);
            if(this.forceValidation === true || String(value) !== String(startValue)){
                var e = {
                    grid: this,
                    record: r,
                    field: field,
                    originalValue: startValue,
                    value: value,
                    row: ed.row,
                    column: ed.col,
                    cancel:false
                };
                if(this.fireEvent("validateedit", e) !== false && !e.cancel && String(value) !== String(startValue)){
                    r.set(field, e.value);
                    delete e.cancel;
                    this.fireEvent("afteredit", e);
                }
            }
            this.view.focusCell(ed.row, ed.col);
                if(!ed.field.isValid(true)){
                    var cell = this.getView().getCell(ed.row, ed.col);
                    cell = Ext.get(cell);
                    cell.addClass('x-form-invalid');
                }
        }
    })
    hope this helps.
    Any ideas as to how can this be setup in ExtJS 4 (since Ext.Editor is no longer defined)? Thanks