Minor changes in the Table widget validation

This commit is contained in:
alekseybobkov 2015-01-13 18:44:20 -08:00
parent 433e99d6e7
commit 70d3778611
5 changed files with 3063 additions and 933 deletions

View File

@ -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');

View File

@ -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

View File

@ -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)