Passing the control, and field information along with the model while

rendering the Select control.
pull/3/head
Ashesh Vashi 2016-01-05 13:18:46 +05:30
parent aec96b4933
commit 9f8a46c820
1 changed files with 5 additions and 5 deletions

View File

@ -217,15 +217,15 @@
attributes: attributes,
formatter: this.formatter
}),
evalF = function(f, m) {
return (_.isFunction(f) ? !!f(m) : !!f);
evalF = function(f, d, m) {
return (_.isFunction(f) ? !!f.apply(d, m) : !!f);
};
// Evaluate the disabled, visible, and required option
_.extend(data, {
disabled: evalF(data.disabled, this.model),
visible: evalF(data.visible, this.model),
required: evalF(data.required, this.model)
disabled: evalF(data.disabled, data, this.model),
visible: evalF(data.visible, data, this.model),
required: evalF(data.required, data, this.model)
});
// Evaluation the options
if (_.isFunction(data.options)) {