首先让我给你一些警告。您的映射仅适用于该特定板和任何其他视图。因此,更改很容易不同步。
这是一些应该做你所期望的代码。你可以在这里得到它的要点
https://gist.github.com/2926610
<!DOCTYPE html>
<html>
<head>
<title>My Custom App</title>
<!--Include SDK-->
<script type="text/javascript" src="https://rally1.rallydev.com/apps/2.0p/sdk.js"></script>
<!--App code-->
<script type="text/javascript">
Rally.onReady(function() {
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
mappedToField:"State",
mappedFromField:"Mapme",
fieldNameMap:{
a:"Defined",
b:"Defined",
c:"In-Progress",
d:"In-Progress",
e:"Completed"
},
launch: function() {
this.add({
xtype:'rallycardboard',
types:['task'],
attribute: this.mappedFromField,
listeners:{
beforecarddroppedsave:function(cardboard, card) {
//map the new state from on this card to the new state
var newState = this.fieldNameMap[card.record.get(this.mappedFromField)];
card.record.set(this.mappedToField, newState);
},
scope:this
}
});
}
});
Rally.launchApp('CustomApp', {
name: 'My Custom App'
});
});
</script>
</head>
<body class="myApp">
</body>
</html>