我有最简单的CardBoard实现:
<!DOCTYPE html>
<html>
<head>
<title>CardBoard Example</title>
<script type="text/javascript" src="/apps/2.0p5/sdk.js"></script>
<script type="text/javascript">
Rally.onReady(function() {
Ext.define('CustomApp', {
extend: 'Rally.app.App',
launch: function() {
var cardBoardConfig = {
xtype: 'rallycardboard',
types: ['User Story'],
attribute: "ScheduleState"
};
this.add(cardBoardConfig);
}
});
Rally.launchApp('CustomApp', {
name: 'CardBoard Example'
});
});
</script>
<style type="text/css">
</style>
</head>
<body></body>
</html>
每次拖放操作后都会出现非常恼人的问题:页面刷新。
此外,我注意到一些阻止页面重新加载的错误。重现的步骤:
如果没有javascript Rally SDK错误,如何在卡片拖放操作后阻止页面刷新?
答案 0 :(得分:0)
这是由父窗口对objectUpdate message的处理不当造成的。删除卡后,objectUpdate
消息将被(正确)触发,但自定义HTML面板会通过刷新应用程序来处理它。我已经向Rally提交了一个错误来修复它。
要覆盖此行为,请在Rally.onReady
:
if(window.parent) {
window.parent.RALLY.ui.dashboard.PanelPanel.prototype.onObjectModificationMessage = function(){};
}
所以整个代码看起来像:
<!DOCTYPE html>
<html>
<head>
<title>CardBoard Example</title>
<script type="text/javascript" src="/apps/2.0p5/sdk.js"></script>
<script type="text/javascript">
Rally.onReady(function() {
if(window.parent) {
window.parent.RALLY.ui.dashboard.PanelPanel.prototype.onObjectModificationMessage = function(){};
}
Ext.define('CustomApp', {
extend: 'Rally.app.App',
launch: function() {
var cardBoardConfig = {
xtype: 'rallycardboard',
types: ['User Story'],
attribute: "ScheduleState"
};
this.add(cardBoardConfig);
}
});
Rally.launchApp('CustomApp', {
name: 'CardBoard Example'
});
});
</script>
<style type="text/css">
</style>
</head>
<body></body>
</html>
答案 1 :(得分:0)
这是一个类似的问题,答案稍有不同,对你也有用:
App works as desired in debug mode but crashes in Rally environment