Show the disabled control in view only mode of properties

pull/3/head
Ashesh Vashi 2015-07-22 22:27:32 +05:30
parent 86479453b3
commit 146e901327
2 changed files with 12 additions and 3 deletions

View File

@ -165,9 +165,10 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, Backform) {
typeof newModel[f.show] == "function" ? typeof newModel[f.show] == "function" ?
newModel[f.show] : undefined, newModel[f.show] : undefined,
// This can be disabled in some cases (if not hidden) // This can be disabled in some cases (if not hidden)
disable: f.disable && newModel[f.disable] && disabled: (type == 'properties' ? true : (
typeof newModel[f.disable] == "function" ? f.disabled && newModel[f.disabled] &&
newModel[f.disable] : undefined, typeof newModel[f.disabled] == "function" ?
newModel[f.disabled] : undefined)),
options: f.options options: f.options
}); });
} }

View File

@ -57,6 +57,14 @@
that.listenTo(that.model, "change:" + name, that.render); that.listenTo(that.model, "change:" + name, that.render);
}); });
}; };
Backform.Control.prototype.template = _.template([
'<label class="<%=Backform.controlLabelClassName%>"><%=label%></label>',
'<div class="<%=Backform.controlsClassName%>">',
' <span class="<%=Backform.controlClassName%> uneditable-input" <%=disabled ? "disabled" : ""%>>',
' <%=value%>',
' </span>',
'</div>'
].join("\n"));
// Backform Dialog view (in bootstrap tabbular form) // Backform Dialog view (in bootstrap tabbular form)
// A collection of field models. // A collection of field models.