Skip to content

Instantly share code, notes, and snippets.

@ferentchak
Created June 13, 2012 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ferentchak/2926610 to your computer and use it in GitHub Desktop.
Save ferentchak/2926610 to your computer and use it in GitHub Desktop.
Map Task States
<!DOCTYPE html>
<html>
<head>
<title>My Custom App</title>
<!--Include SDK-->
<script type="text/javascript" src="https://demo.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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment