Class: SC.LinkView
This view creates a link (i.e. HTML anchor) to a remote resource. You should use this view to create programmatic HTML links, such as links to a PDF or to an external site.
For example,
//...
// A link to download the selected employee's resume.
link: SC.LinkView.extend({
body: "Current Resume",
// Compute the fileName on the fly.
fileNameBinding: SC.Binding.oneWay('MyApp.employeeController.fullName')
.transform(function (fullName) {
// ex. "Resume - Tyler Keating.pdf"
return "Resume - " + fullName + ".pdf";
}),
// Compute the href on the fly.
hrefBinding: SC.Binding.oneWay('MyApp.employeeController.resumePath'),
toolTip: "Link to current resume"
}),
//...
The example above generates something like the following,
<a href="/users/22/cur-resume.pdf" class="sc-view sc-link-view" download="Resume - Tyler Keating.pdf" title="Link to current resume">Current Resume</a>
Note that you can localize the body
and the toolTip
by setting the localize
property to true.
Defined in: link_view.js
- Since:
- SproutCore 1.11
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:20 GMT-0600 (CST)