Created
June 13, 2012 21:34
-
-
Save ferentchak/2926610 to your computer and use it in GitHub Desktop.
Map Task States
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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