PDA

View Full Version : [FIXED] [modern, 6.5.2] broken link "Ext.data.validator" @docs for Ext.field.Field.validator



valio
1 Oct 2017, 11:43 PM
The link for the isValid-method is broken at http://docs.sencha.com/extjs/6.5.2/modern/Ext.field.Field.html#cfg-validators

If I am not mistaken the corresponding doc comment should be


/**
* @cfg {Mixed}
* A validator or array of validators to be applied to the field.
*
* When the field is validated, each validator is applied and if any one of them
* determines the field is invalid, the field will be marked as invalid. If you
* examine the field's validators, you will get an array of Ext.data.Validators.
*
* Validation currently is synchronous. If you need to validate a field with interaction
* with a server, you would do this when the form is submitted.
*
* A validator may be:
*
* * A regexp - if the field fails to match the regexp, it is invalid.
* * A function - the function will be called to validate the field; it should return false if invalid.`
* * An object - an object with a member fn that is a function to be called to validate the field.
* * An instantiated Validator {@link Ext.data.validator.Validator}
*/

instead of


/**
* @cfg {Mixed}
* A validator or array of validators to be applied to the field.
*
* When the field is validated, each validator is applied and if any one of them
* determines the field is invalid, the field will be marked as invalid. If you
* examine the field's validators, you will get an array of Ext.data.Validators.
*
* Validation currently is synchronous. If you need to validate a field with interaction
* with a server, you would do this when the form is submitted.
*
* A validator may be:
*
* * A regexp - if the field fails to match the regexp, it is invalid.
* * A function - the function will be called to validate the field; it should return false if invalid.`
* * An object - an object with a member fn that is a function to be called to validate the field.
* * An instantiated Validator {@link Ext.data.validator}
*/

valio
1 Oct 2017, 11:47 PM
Furthermore it would be nice if an example would be provided for the object.

It's not clear why it could be preferable to call setValidators with an object like

{ fn: ()=>{ /* validator code */ } }
instead of just a function

()=>{ /* validator code */ }

sandeep.adwankar
2 Oct 2017, 7:17 AM
Thanks for the report! I have opened a bug in our bug tracker.