-
-
Save jsmarkus/5106508 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var opt = new Option({ | |
field: 'decorations' | |
trigger: 'Рюшечки 2Б', | |
calc: function() { | |
var razv = this.getOption('razv'); | |
var price = 30 * (razv + 1); | |
return price; | |
}, | |
validate: function () { | |
var mat = this.getOption('material'); | |
if(mat === 'Кожа') { | |
//возвращаем признак того, что сработало ограничение | |
return new ValidationError{ | |
code : 'RESCRICTION', | |
message : 'На коже рюшечки 2Б не делаются' | |
} | |
} else { | |
//все нормально | |
return false; | |
} | |
} | |
}); | |
calc.add(opt); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment