1

我有最简单的 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>

每次拖放操作后都会出现非常烦人的问题:页面刷新。

我还注意到一些阻止页面重新加载的错误。重现步骤:

  1. 使用上面的代码打开页面;
  2. 改变项目范围;
  3. 拖放卡片;
  4. 您将在浏览器控制台中看到阻止页面刷新的 javascript 错误。

在没有javascript Rally SDK错误的情况下,如何防止卡片拖放操作后刷新页面?

4

2 回答 2

0

这是由于父窗口对objectUpdate 消息的处理不当造成的。当卡片被放下时,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>
于 2013-05-07T12:49:50.830 回答
0

这是一个类似的问题,答案略有不同,也应该对您有用:

应用程序在调试模式下按需要运行,但在 Rally 环境中崩溃

于 2013-05-07T15:40:27.643 回答