PDA

View Full Version : Exception on iPad when trying to add panel after removing



muzikant_777
17 Jul 2011, 9:20 AM
Hi all,

I have an exception that appears only in iPad Safari (in desktop Chrome all is Ok)

JavaScript Error 28890
http:.../sencha-rouch-debug.js
TypeError: Result of expression 'dom' [undefined] is not an object.

This error appears when I trying to remove panel 'item' from parent panel 'p1' and then add removed panel 'item' into another panel 'p2'. Then I change orientation (landscape or portrait) and error appears.

Here is simple code example for this:



new Ext.Application({
launch: function() {
var item = new Ext.Panel({
width: 50,
height: 50,
cls: 'a-tester'
});

var p1 = new Ext.Panel();
var p2 = new Ext.Panel();

var container = new Ext.Panel({
fullscreen: true,
items: [
p1,
p2
]
});
p1.add(item);
p1.doLayout(true, true);
p1.remove(item);
p2.add(item);
p1.doLayout(true, true);
}
});


Can you also advice how to change complex layout when orientation changed? I need to regroup some elements into panel. But the only way I found is to create new layout with new container panels and same elements (thats why I need to remove and then add panels).

Thanks,
Gennadiy