Page 9 of 12 FirstFirst ... 7891011 ... LastLast
Results 81 to 90 of 120

Thread: [New] Remote Field Validation Plugin

  1. #81
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664

    Default

    There was one bug pointed out a couple of posts back. Take the code now it's been fixed.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  2. #82

    Default

    The new ServerValidator isn't an Singleton as the first one... So you have to use:

    PHP Code:
    plugins:[new Ext.us.form.ServerValidator({ ... config ... })] 

  3. #83
    Sencha User
    Join Date
    May 2007
    Posts
    26

    Default

    "Ext.ux.form is undefined" when using the successor of RemoteValidator.


  4. #84
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664

    Default

    Add Ext.ns('Ext.ux.form'); at the beginning of the code.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  5. #85
    Sencha User
    Join Date
    May 2007
    Posts
    26

    Default

    Thank's a lot Jozef ... yesterday I was too tired to do anything !


    The only think that I can't do is to use the "Get" method ... adding (#fieldname) in url break the querystring.

  6. #86

    Default

    the firebug show the error:uncaught exception: Server error: undefined
    why??
    my server return the JSON object is [{"success":false},{"errors":"this is bad value "}] or [{"success":true}]
    please help me,thanks

  7. #87
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664

    Default

    {"success":false, "errors":"this is bad value"}
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  8. #88
    Ext User
    Join Date
    Apr 2008
    Location
    Ravenna, Italy
    Posts
    41

    Default Validation considering other fields

    Hi Saki,
    in my application I need to validate a field, considering other fields value, so I can't set all params when I'm creating the object. I need to specify params as functions and evaluate the function every time I validate the field; so I modified validateRemote:

    PHP Code:
    validateRemote:function() {
        
    this.rvOptions.params this.rvOptions.params || {};
        
    this.rvOptions.params.field this.name;
        
    this.rvOptions.params.value this.getValue();
        
        var 
    actualOptions = {params:{}};
        for (
    propName in this.rvOptions.params){
            var 
    this.rvOptions.params[propName];
            if (
    typeof p === 'function')
                
    actualOptions.params[propName] = p.call(this);
            else
                
    actualOptions.params[propName] = p;
        }
        
    Ext.applyIf(actualOptions,this.rvOptions);
        
        
    Ext.Ajax.request(actualOptions);

    And now I can use the plugin in this way:
    PHP Code:
    {
        
    id'titolo',
        
    name'titolo',
        
    xtype'textfield',
        
    fieldLabel'Titolo',
        
        
    plugins:[Ext.ux.plugins.RemoteValidator],
        
    rvOptions: {
            
    urlURL.isTitoloUnivoco,
            
    params:{
                
    idCategoria: function(){return Ext.getCmp('myForm').getForm().findField('idCategoria').getValue()}
           }
        }

    If you want, you can use my code in plugin.

  9. #89
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664

    Default

    Thanks for sharing. Maybe it helps others with a similar problem.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  10. #90
    Sencha User
    Join Date
    Oct 2007
    Posts
    57

    Default serverValidate runs only once?

    Saki

    I tried your new serverValidate.
    It seems to run only once on a certain field unless you click outside the field an go back into it. (B.t.w. I'm using it together with InlineTextField user extension.)
    Would that be my error?

    PHP Code:
    ...
        
    plugins:[new Ext.ux.form.ServerValidator({
            
    validationEvent:'keyup',
            
    validationDelaydelay,
            
    urlrvUrl,
            
    method'POST',
            
    success: function(resultrequest) {
                
    this.handleSuccess(resultrequest);
                var 
    json Ext.util.JSON.decode(result.responseText);
                if (
    json.reasonExt.MessageBox.alert('Info'json.reason);
            },
            
    failurefailureFn
        
    })],
    ... 
    Thx for any help!

    Patrick

Page 9 of 12 FirstFirst ... 7891011 ... LastLast

Posting Permissions

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