Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    17
    Answers
    1
    Vote Rating
    -1
    chaostimmy is an unknown quantity at this point

      0  

    Default Answered: Passing VTypes the current Formfield

    Answered: Passing VTypes the current Formfield


    Heya, i want to use VTypes but need the Formfield that is currently being validated..

    in the VType example (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.VTypes) is shown the following:
    Code:
    // custom Vtype for vtype:'time'
    var timeTest = /^([1-9]|1[0-9]):([0-5][0-9])(\s[a|p]m)$/i; 
    Ext.apply(Ext.form.field.VTypes, {
        //  vtype validation function
         time: function(val, field) {
             return timeTest.test(val);
         },
         // vtype Text property: The error text to display when the validation function returns false
         timeText: 'Not a valid time.  Must be in the format "12:34 PM".',
         // vtype Mask property: The keystroke filter mask
         timeMask: /[\d\s:amp]/i
     });
    But when I try that, the field argument is always empty....

    solutions? suggestions?

  2. This seems to work, please check on your end.

    Code:
    // custom Vtype for vtype:'time'
    var timeTest = /^([1-9]|1[0-9]):([0-5][0-9])(\s[a|p]m)$/i;
    Ext.apply(Ext.form.field.VTypes, {
        //  vtype validation function
        time: function(val, field) {
        	console.log(field);
            return timeTest.test(val);
        },
        // vtype Text property: The error text to display when the validation function returns false
        timeText: 'Not a valid time.  Must be in the format "12:34 PM".',
        // vtype Mask property: The keystroke filter mask
        timeMask: /[\d\s:amp]/i
    });
    
    Ext.onReady(function(){
    
    	Ext.create('Ext.form.field.Text', {
    	    fieldLabel: 'Departure Time',
    	    name: 'departureTime',
    	    vtype: 'time', // applies custom time validation rules to this field
    	    renderTo: Ext.getBody()
    	});
     
    });
    Regards,
    Scott.

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,862
    Answers
    651
    Vote Rating
    438
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      1  

    Default


    This seems to work, please check on your end.

    Code:
    // custom Vtype for vtype:'time'
    var timeTest = /^([1-9]|1[0-9]):([0-5][0-9])(\s[a|p]m)$/i;
    Ext.apply(Ext.form.field.VTypes, {
        //  vtype validation function
        time: function(val, field) {
        	console.log(field);
            return timeTest.test(val);
        },
        // vtype Text property: The error text to display when the validation function returns false
        timeText: 'Not a valid time.  Must be in the format "12:34 PM".',
        // vtype Mask property: The keystroke filter mask
        timeMask: /[\d\s:amp]/i
    });
    
    Ext.onReady(function(){
    
    	Ext.create('Ext.form.field.Text', {
    	    fieldLabel: 'Departure Time',
    	    name: 'departureTime',
    	    vtype: 'time', // applies custom time validation rules to this field
    	    renderTo: Ext.getBody()
    	});
     
    });
    Regards,
    Scott.

  4. #3
    Sencha User
    Join Date
    May 2011
    Posts
    17
    Answers
    1
    Vote Rating
    -1
    chaostimmy is an unknown quantity at this point

      0  

    Default


    oh nooo..

    why does Ext.log(field) say "empty string"
    and
    console.log(field) show the object??



    thank you very much for helping me finding the problem!

Thread Participants: 1

Tags for this Thread