First this one works:
win.remove(formLogin, true);
win.add(changepswform);
win.doLayout();
Then this one does not wok:
win.add(changepswform);
win.remove(formLogin, true);
win.doLayout();
I get this error:
uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMHTMLDivElement.insertBefore]" nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame :: http://app.localhost.com/ext-4.0.2/ext-all.js :: <TOP_LEVEL> :: line 15" data: no]
[Break On This Error] (function(){var e=this,a=Object.protot...ate("Ext.XTemplate",j,g)}return j}});
Whose fault is this? Mine? Or ExtJs has a bug?
Note:
var win = Ext.create('Ext.Window', {
title: 'Asistan Web: Online Teknik Servis Yazılımı',
width: 350,
minWidth: 350,
height: 240,
closable: false,
modal: true,
bodyStyle: 'padding:10px;',
items: [formLogin],
bbar: Ext.create('Ext.ux.StatusBar', {
id: 'win-statusbar',
defaultText: 'Giriş',
items: [
{
xtype:'splitbutton',
text:'Şifre işlemleri',
menuAlign: 'br-tr?',
menu: Ext.create('Ext.menu.Menu', {
items: [{text: LANG.LOGIN_FORGOT_PASS, handler :
function(){
if(confirm(LANG.LOGIN_MAIL_CONFIRM))doformTest(1);
Ext.getCmp('win-statusbar').setText('');
}}, {text: LANG.LOGIN_CHANGE_PASS, handler : function(){doformTest(2);}}]
})
}]
})
});
It looks like you're trying to remove a component in the second block that you've already removed in the first block. Or are you not running the two scripts sequentially?
Using true on .remove method you force garbage collection, thus removing the variable entirely AFAIK.
Edit: FOUND solution, How can I replace the content of a panel with new content? STILL, if you want to re-use (let's say swap multiple times) your panels, you have to use false on .remove()
User contributions licensed under CC BY-SA 3.0