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" ?
newModel[f.show] : undefined,
// This can be disabled in some cases (if not hidden)
disable: f.disable && newModel[f.disable] &&
typeof newModel[f.disable] == "function" ?
newModel[f.disable] : undefined,
disabled: (type == 'properties' ? true : (
f.disabled && newModel[f.disabled] &&
typeof newModel[f.disabled] == "function" ?
newModel[f.disabled] : undefined)),
options: f.options
});
}

View File

@ -57,6 +57,14 @@
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)
// A collection of field models.