Minor changes in the Table widget validation
This commit is contained in:
parent
433e99d6e7
commit
70d3778611
|
|
@ -129,11 +129,7 @@ class Table extends WidgetBase
|
|||
{
|
||||
$this->addCss('css/table.css', 'core');
|
||||
|
||||
// Include a combined and minified script.
|
||||
// TODO: At the moment the files are combined with
|
||||
// CodeKit 2, but we should have a method to
|
||||
// combine files without external dependencies. -ab
|
||||
$this->addJs('js/table-min.js', 'core');
|
||||
$this->addJs('js/build-min.js', 'core');
|
||||
|
||||
/*
|
||||
$this->addJs('js/table.js', 'core');
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ The client-side validation is configured in the widget configuration file in the
|
|||
validation:
|
||||
required:
|
||||
message: Please select the state
|
||||
applyIfNotEmpty: country
|
||||
requiredWith: country
|
||||
|
||||
If a validator doesn't have any options (or default option values should be used), the declaration could look like this:
|
||||
|
||||
|
|
@ -295,7 +295,7 @@ If a validator doesn't have any options (or default option values should be used
|
|||
validation:
|
||||
required: {}
|
||||
|
||||
The `applyIfNotEmpty` and `message` parameters are common for all validators.
|
||||
The `requiredWith` and `message` parameters are common for all validators.
|
||||
|
||||
Currently implemented client-side validation rules:
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -30,7 +30,7 @@
|
|||
* target row.
|
||||
*/
|
||||
Base.prototype.validate = function(value, rowData) {
|
||||
if (this.options.applyIfNotEmpty !== undefined && !this.rowHasValue(this.options.applyIfNotEmpty, rowData))
|
||||
if (this.options.requiredWith !== undefined && !this.rowHasValue(this.options.requiredWith, rowData))
|
||||
return
|
||||
|
||||
return this.validateValue(value, rowData)
|
||||
|
|
|
|||
Loading…
Reference in New Issue