本文介绍了如何从sencha触摸导航堆栈中删除特定视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在推送这样的视图 this.up('navView')。push({xtype:'myView'})

I'm pushing views like this this.up('navView').push({xtype: 'myView'})

如何删除位于导航堆栈中的特定视图?

How can I remove particular view, which is in the middle of navigation stack?

至少我应该摆脱这个警告

At least I should get rid of this warning

[WARN][Ext.Component#constructor] Registering a component with a id (listxyz) which has already been used. Please ensure the existing component has been destroyed (Ext.Component#destroy().


推荐答案

在推送视图检查天气之前,视图已经存在,并且如果已经存在,则将其消除,因此您不会收到这些警告并且可以轻松导航。

Before pushing a view check weather the view already exists, and destroy it if its already there, so you wont get those warnings and can navigate easily.

if(Ext.getCmp('myView')){
                Ext.getCmp('myView').destroy();
}

//Push myView

where  myView should be the id of that view declared in config of that view


    config: {

        id:'myView',

    }

这篇关于如何从sencha触摸导航堆栈中删除特定视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 19:43