Sencha touch picker Error: Cannot read property 'dom' of null

Sencha touch picker Error: Cannot read property 'dom' of null

我在sencha touch中创建了一个选择器。

然后像这样添加到视口中:

Ext.Viewport.add(picker);
picker.show();

然后,当我尝试将其从视口中移除时,它会在控制台中抛出 js 错误。 代码是:

Ext.Viewport.remove(picker, true);

无法读取 Container.js

中的空 属性 'dom'
Ext.Viewport.remove(picker, true);

您需要将上面的代码放在延迟中,如下所示。它至少需要更多的延迟。

Ext.defer(function(){
      Ext.Viewport.remove(picker, false);
}, 500);