Sencha touch GetCmp()在sencha中不起作用

Sencha touch GetCmp()在sencha中不起作用,sencha-touch,sencha-touch-2,Sencha Touch,Sencha Touch 2,我使用的是getCmp('componentid').hide() 它不起作用 if (flag_in == 1) { console.log('inside if of hide'); Ext.getCmp('inboxQueueId').hide(); var el = btn.el; Ext.getCmp('inbox_hide').setIconCls('show');

我使用的是
getCmp('componentid').hide()
它不起作用

if (flag_in == 1) {
    console.log('inside if of hide'); 
    Ext.getCmp('inboxQueueId').hide();                                    

    var el = btn.el;  
    Ext.getCmp('inbox_hide').setIconCls('show');                              
    flag_in = 0;
    Ext.getCmp('queueViewPanel').setWidth('100%');

} else {
      console.log('inside else of hide'); 
   Ext.getCmp('inboxQueueId').show();                               

  var element = btn.element;
  Ext.getCmp('inbox_hide').setIconCls('hide');

 flag_in = 1;
 Ext.getCmp('queueViewPanel').setWidth('70%');
 }
如果Ext.getCmp('inboxQueueId').hide()
不起作用,它将进入内部。 而且它没有给出错误。 请帮帮我。

试试这个

Ext.getCmp('inboxQueueId')。hide('slide',false)

或者像这样的

Ext.getCmp('inboxQueueId').hide(false)


我希望这有帮助。:)

如何定义id为“inboxQueueId”的对象?inboxQueueId是我要隐藏的面板的id。如果在Chrome中测试,请尝试编写Ext.getCmp('inboxQueueId').hide();在Chrome控制台中。测试一点,或者给我看看你的代码。对于Ext.getCmp('inboxQueueId')。hide('slide',false)它没有给出错误,但没有隐藏左面板。对于Ext.getCmp('inboxQueueId')。setVisible(false)它的给出错误:没有方法setVisible()。我的应用程序dulpicate id存在,这就是它不工作的原因。我删除了dulicate id,现在工作正常。