PDA

View Full Version : 'skipGarbageCollection': object is null or undefined



civbaron
23 Mar 2012, 1:38 PM
Hi,
I am trying to load a panel into IE 9 with compatibility mode turned off using Ext Js 4, the panel loads but after a short time an error occurs in javascript stating.

Here is the code used to create the panel.

Ext.onReady(
function(){"use strict"; createMainPanel();});

function
createMainPanel()

{


"use strict";


//create Main window panel


var main = createPanel(window.innerWidth, window.innerheight, 'mainpanel', 'auto', 'mainPanelDiv');


//main.addClass('reportMainPanel');


//main.border = '0 0 0 0';


//create tabPanel


//var tabPanel = populateProviderReportTab(main);




//main.add([{items:[tabPanel]}]);

}



function
createPanel(panelWidth, panelHeight, panelID, panelLayoutType, panelRenderTo)

{


'use strict';




if(panelRenderTo !== undefined )

{


return Ext.create('Ext.panel.Panel', {

id: panelID,

width: panelWidth,

height: panelHeight,

layout: panelLayoutType,

renderTo: Ext.getBody()

});

}


elseif(panelRenderTo === undefined)

{


return Ext.create('Ext.panel.Panel', {

id: panelID,

width: panelWidth,

height: panelHeight,

layout: panelLayoutType

});

}

}
At first I thought it was an issue with an extra comma somewhere that is not the case. I removed all the code and only left in the renderTo but that also still caused the error. It seems to be happening within the getId function. Here is the code it is happening on:


if (!Ext.cache[id]){

Ext.Element.addToCache(
new Ext.Element(element), id);


if (skipGarbageCollection) {

Ext.cache[id].skipGarbageCollection =
true;

}

}


Any help would be greatly appreciated.

Thanks

civbaron
26 Mar 2012, 11:04 AM
I think this issue is resolved in the 4.1 beta of Ext JS. I changed my code to use this instead of the 4.0 and it seems to be working now perfectly. I am no longer getting the error when leaving the window open for long periods of time.