App works as desired in debug mode but crashes in Rally environment

半城伤御伤魂 提交于 2019-12-24 03:39:15

问题


I have created an app that creates a grid dynamically, as well as lets the user make changes to one of the grid columns via a 'numberfield' editor. Everything is working great in the debug environment but when I try to edit one of the fields in the Rally environment it crashes the app. From the looks of it, the iframe containing the app is just reloading altogether.

Now, here's the weird part that may be a clue to what's going on. The app crashes after I click elsewhere on the app (committing the change) but if I scroll the mouse wheel somewhere on the app, the spinner loses focus (no up/down arrows) and then if I click somewhere the edits are applied and the app doesn't crash. Once again in the debug mode I don't need to go through this, I can just click elsewhere and the changes are applied.


回答1:


This is a known issue with 2.0p5 that will be fixed with the next release of the SDK. Basically it's using a sledgehammer to respond to the fact that something was edited and refreshing it. Since the new SDK can communicate with the message bus this is totally unnecessary...

In the meantime you should be able to patch your app by defining a global Rally.getApp function that returns your app instance to prevent the hard refresh:

//In your app definition give it an xtype:
Ext.define('My.App', {
    extend: 'Rally.app.App',
    //...
    alias: 'widget.myapp'
    //...
});

//Find the app instance by its xtype and return it
Rally.getApp = function() {
    return Ext.ComponentQuery.query('myapp')[0];
};

You can then delete that code once 2.0p6 is released and you upgrade.



来源:https://stackoverflow.com/questions/14220129/app-works-as-desired-in-debug-mode-but-crashes-in-rally-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!