1

I have created one picker in sencha touch.

Then added into viewport like this:

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

Then when I try to remove it from viewport it is throwing js error in console. code is:

Ext.Viewport.remove(picker, true);

Cannot read property 'dom' of null in Container.js

Dr. Piyush Dholariya
  • 1,266
  • 16
  • 31

1 Answers1

0
Ext.Viewport.remove(picker, true);

You need to put above code in defer as below. It requires at least more delay.

Ext.defer(function(){
      Ext.Viewport.remove(picker, false);
}, 500);
Dr. Piyush Dholariya
  • 1,266
  • 16
  • 31
Rishabh Shah
  • 541
  • 7
  • 28
  • 1
    thanks but I require 500ms time for defer. 'cause after destroying the picker code try to execute some code in Container.js hence we required to destroy picker after execution of all code. – Dr. Piyush Dholariya Dec 28 '15 at 07:19