我正在尝试设置两个下拉菜单。一个中的值取决于另一个的当前值。如何链接它们,当我在一个下拉菜单中更改所选值时,它会自动更新另一个下拉菜单?
谢谢。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>User Stories By Iteration</title>
<meta name="Name" content="App Example: User Stories Table" />
<script type="text/javascript" src="/apps/1.32/sdk.js"></script>
<script type="text/javascript">
var rallyDataSource;
var relDropdown;
var table;
var relDropdown2;
function onReleaseSelected(releases, eventArgs) {
var queryConfig = {
type : 'testset',
attribute : 'Name',
query: '(Release.Name = "' + releases.getDisplayedValue() + '")'
};
relDropdown2 = new rally.sdk.ui.ObjectDropdown(queryConfig, rallyDataSource);
relDropdown2.display(document.getElementById("releaseDiv2"));
}
function onLoad() {
rallyDataSource = new rally.sdk.data.RallyDataSource('__WORKSPACE_OID__',
'__PROJECT_OID__',
'__PROJECT_SCOPING_UP__',
'__PROJECT_SCOPING_DOWN__');
var relConfig = {};
relDropdown = new rally.sdk.ui.ReleaseDropdown(relConfig, rallyDataSource);
relDropdown.display(document.getElementById("releaseDiv"), onReleaseSelected);
}
rally.addOnLoad(onLoad);
</script>
</head>
<body>
<div>
<div id="releaseDiv"></div>
<div id="releaseDiv2"></div>
</div>
<br/><br/>
</body>
</html>