Skip to content

Instantly share code, notes, and snippets.

@tritchey
Created July 6, 2011 13:52
Show Gist options
  • Save tritchey/1067272 to your computer and use it in GitHub Desktop.
Save tritchey/1067272 to your computer and use it in GitHub Desktop.
template with validator
<span class="label">{{loc "_Port"}}</span>
{{view PortField valueBinding="ScaleUI.alertSMTPController.port"}}
PortField: SC.TextField.extend(SC.Validatable, {
validator: SC.Validator.PositiveInteger.extend({ places: 0 })
}),
ScaleModel.AlertSMTP = SC.Record.extend(
/** @scope ScaleModel.AlertSMTP.prototype */ {
smtpServer: SC.Record.attr(String),
useSSL: SC.Record.attr(Boolean),
port: SC.Record.attr(Number),
requiresAuthentication: SC.Record.attr(Boolean, { key: 'useAuth' }),
username: SC.Record.attr(String, { key: 'authUser' }),
password: SC.Record.attr(String, { key: 'authPassword' }),
cluster: SC.Record.toOne("ScaleModel.Cluster", {
inverse: "alertSMTP", isMaster: NO
})
}) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment