我的目标是使用仪表板上的拉力网格在自定义 HTML 应用程序中显示一些自定义投资组合字段(该字段称为执行冠军)。我已经查看了文档和一些示例,但看起来这不可能。有没有人做到这一点以及如何做到的?我的代码如下。我使用以下内容开始https://github.com/davidpthomas/BasicRallyGrid。
<!DOCTYPE html>
<html>
<head>
<title>BasicRallyGrid</title>
<script type="text/javascript" src="/apps/2.0rc2/sdk.js"></script>
<script type="text/javascript">
Rally.onReady(function () {
// Custom Rally App that displays Stories in a grid.
//
// Note: various console debugging messages intentionally kept in the code for learning purposes
Ext.define('CustomApp', {
extend: 'Rally.app.App', // The parent class manages the app 'lifecycle' and calls launch() when ready
componentCls: 'app', // CSS styles found in app.css
// Entry Point to App
launch: function() {
console.log('our first app'); // see console api: https://developers.google.com/chrome-developer-tools/docs/console-api
this._loadData(); // we need to prefix with 'this.' so we call a method found at the app level.
},
// Get data from Rally
_loadData: function() {
var myStore = Ext.create('Rally.data.wsapi.Store', {
model: 'PortfolioItem',
autoLoad: true, // <----- Don't forget to set this to true! heh
listeners: {
load: function(myStore, myData, success) {
console.log('got data!', myStore, myData);
this._loadGrid(myStore); // if we did NOT pass scope:this below, this line would be incorrectly trying to call _createGrid() on the store which does not exist.
},
scope: this // This tells the wsapi data store to forward pass along the app-level context into ALL listener functions
},
fetch: ['Executive Champion', 'Name', 'ScheduleState'] // Look in the WSAPI docs online to see all fields available!
});
},
// Create and Show a Grid of given stories
_loadGrid: function(myStoryStore) {
var myGrid = Ext.create('Rally.ui.grid.Grid', {
store: myStoryStore,
columnCfgs: [
'Executive Champion', 'Name', 'ScheduleState'
]
});
this.add(myGrid);
console.log('what is this?', this);
}
});
Rally.launchApp('CustomApp', {
name:"BasicRallyGrid",
parentRepos:""
});
});
</script>
<style type="text/css">
.app {
/* Add app styles here */
}
</style>
</head>
<body></body>
</html>