EditLink

Deprecation Warning! The content below is only applicable for use within deprecated 1.x versions of CA Agile Central's App SDK. Use of the component(s) and/or code on this page is not supported. To develop custom apps within our current environments, please see App SDK 2.0 documentation.

The EditLink component provides an easy way to create a pop-up of the CA Agile Central edit page for an item. The underlying functionality to launch the edit page is provided by the Navigation utility.

edit

EditLink includes the following topics:

Create an edit link

First include the App SDK JavaScript:

<script type="text/javascript" src="/apps/[version]/sdk.js"></script>

Instantiate a new EditLink:

var link = new rally.sdk.ui.basic.EditLink(config);

The parameters for rally.sdk.ui.basic.EditLink are as follows:

Parameter Description Example
config* A configuration object { item: { "_ref":
"https://rally1.rallydev.com/slm
/webservice/1.26/defect/12345
",
"FormattedID": "S200" } }
  * = required parameter

The EditLink configuration object supports the following properties:

Parameter Description
item* The item to be linked, may be a ref or a CA Agile Central object
text The text of the link
(default = Edit)
  * = required parameter

Display an edit link

Once created, use the display method to display the link:

link.display(domElement);

Parameter Description Example
domElement* The element in which to display the drop-down.
This may be either an element or an element ID.
"element1", document.getElementById("element1")
  * = required parameter

Public methods

Method Name Parameters Description Example
display element* See above link.display("div1");
destroy - Removes this component link.destroy();
renderToHtml - Returns an HTML string representation of the link,
can be useful for including links in a Table
var html = link.renderToHtml();
 * = Required parameter

Example

Copy and paste the following into a CA Agile Central custom app page.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- Copyright (c) 2011 CA Agile Central Software Development Corp. All rights reserved -->
<html>
<head>
    <title>Link Example</title>
    <meta name="Name" content="Component Example: Link" />
    <meta name="Version" content="2010.4" />
    <meta name="Vendor" content="CA Agile Central Software" />
    <script type="text/javascript"src="/apps/1.26/sdk.js"></script>
    <script type="text/javascript">
      function onLoad() {

          var item = {
             FormattedID: "S52",
             "_ref": "https://preview.rallydev.com/slm/webservice/1.26/hierarchicalrequirement/945607.js",
             ObjectID:945607
          };
          var config = {
             item: item
          };
          var linksDiv = document.getElementById("links");
          var link = new rally.sdk.ui.basic.EditLink(config);
          link.display(linksDiv);

         linksDiv.appendChild(document.createElement("br"));
          linksDiv.innerHTML += new rally.sdk.ui.basic.EditLink(config).renderToHtml();
       }

       rally.addOnLoad(onLoad);
       </script>
</head>
<body>
<div id="links"></div>
</body>
</html>

Feedback

Need more help? The CA Agile Central Community is your one-stop shop for self-service and support. To submit feedback or cases to CA Agile Central Support, find answers, and collaborate with others, please join us in the CA Agile Central Community.