Results 1 to 3 of 3

Thread: Ext.override readOnly

  1. #1

    Default Ext.override readOnly

    Do I risk to have bugs with this code?

    Code:
    //Add function to Field and all class which extend from it.
    Ext.override(Ext.form.Field, {
    
              // Block user to change value of a field
              R : function(){
                      document.getElementById(this.id).readOnly=true;
              },
        
              // Allow user to change value of a field
              RW : function(){
                      document.getElementById(this.id).readOnly=false;
              },
    
    });

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    You really think that's a good API to have to code to? Can you make it any more cryptic?

    Code:
    Ext.override(Ext.form.Field, {
              setReadOnly : function(readOnly){
                      this.el.dom.readOnly = readOnly === true;
              }
     })
    Note that this will probably not do what you want on the more complex descendants of Field and will need more work.

  3. #3

    Default

    thx for answers

    tryanDLS I just understand what you mean, my function don't permit me to set a checkbox to read only

    Do you have an idea on the way to do it?

Posting Permissions

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