1. #1
    Sencha Premium Member seek's Avatar
    Join Date
    Sep 2008
    Location
    Italy
    Posts
    112
    Vote Rating
    1
    seek is on a distinguished road

      0  

    Question Ext.form.textField.maxLength dynamically changed with stop typing

    Ext.form.textField.maxLength dynamically changed with stop typing


    Hi people,
    there is a way (or a post) on how to solve this problem?
    I'm trying to do it in my template window, reading property from data store field by field:

    PHP Code:
    Ext.ux.templateWindow Ext.extend(Ext.Window, {
    ....
      
    show: function(recordprnt){
        
    this.setBehavior();
        
    Ext.ux.editWindow.superclass.show.apply(thisarguments);
      },
      
    setBehavior: function(){
        ...
        var 
    l=field.size//field in store is defined as {name: 'myfield', size: 10}
        
    var comp tf.findField(field.name);
        if (
    comp) {
          if(
    l){
            
    comp.maxLength=l;
            
    comp.defaultAutoCreate.size=l//test?!?!?
          
    }
        }
      },
    ...
    }); 
    There is a way to also stop typing in the input field in a similar way?


    Thanks all
    Seek

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Do you want to set maxLength before or after the fields have been rendered?

    The 'maxLength' property can be set whether the field is rendered or not, but the 'maxlength' attribute needs to be set in the autoCreate property before it is rendered, but set as an el attribute after that.

  3. #3
    Sencha Premium Member seek's Avatar
    Join Date
    Sep 2008
    Location
    Italy
    Posts
    112
    Vote Rating
    1
    seek is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    Do you want to set maxLength before or after the fields have been rendered?

    The 'maxLength' property can be set whether the field is rendered or not, but the 'maxlength' attribute needs to be set in the autoCreate property before it is rendered, but set as an el attribute after that.
    Hi Condor, thanks for your fast response.
    As you can see, I try to set the "maxLength" in the "Ext.Window.show" event (before,right?), and in this way I obtain the relative auto-validation chek length in the Ext component (textField in this case).

    I must use?
    PHP Code:
    comp.autoCreate.maxlength 
    Thanks
    Seek

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    You could use:
    Code:
    comp.autoCreate = Ext.apply(comp.autoCreate || Ext.apply({}, comp.defaultAutoCreate), {maxlength: len});
    (only works before the component is rendered!)

  5. #5
    Sencha Premium Member seek's Avatar
    Join Date
    Sep 2008
    Location
    Italy
    Posts
    112
    Vote Rating
    1
    seek is on a distinguished road

      0  

    Default


    Thanks Condor, it work P E R F E C T L Y!!

Similar Threads

  1. Replies: 4
    Last Post: 26 Feb 2010, 1:33 PM
  2. Stop Selection Changed Event on right click
    By sgolla in forum Ext GWT: Discussion
    Replies: 3
    Last Post: 31 Jul 2009, 7:43 PM
  3. Ext.form.TextField does not handle maxLength/size very well.
    By Alan Knowles in forum Ext 1.x: Bugs
    Replies: 8
    Last Post: 8 May 2008, 9:20 AM
  4. How to stop user keystrokes after maxLength
    By super_drone in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 14 Apr 2008, 8:49 AM
  5. Replies: 1
    Last Post: 30 May 2007, 3:11 PM

Thread Participants: 1

Tags for this Thread

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