:: Forum >>

Grid clean up properly?

Hello,

I am implementing a Grid view using version1.0 and run into the road block regarding cleaning up grid. My application uses a single DIV ("viewDiv") to display AW grid and other views, such as bar chart. So, between grid and bar chart, I use

document.getElementById("ViewDiv").innerHTML = "";

to clean up the display area DIV.

But, my bar chart also has its resize event handler, when the DIV is showing bar chart and the brower is resizing, I notice that, in Firefox, the Grid's resize event handler is called as well.

I tried to null out the grid before showing bar chart, I still get the same problem.

So, what is the surest way to clean up the grid? how do I explicitly remove resize event handler if grid's clean up is not possible?

Thanks,

Nick
Monday, March 13, 2006
Just a quick thought - Firefox does not have resize event (or at least it did not fire resize event on DIVs in FF 1.0.x). In AW 1.0 I am using an emulation of the resize event (see /styles/xp/gecko.xml) and maybe this emulation is not 100% correct, so the event handler is not released.

Another quick point - if you are re-using the same grid object there (hopefully) should not be memory leak, but if you keep creating new ones - the old will be still in memory referenced by global AW objects array.
Alex (ActiveWidgets)
Monday, March 13, 2006
Alex,

Is there a way to access global AW objects array and clean up the created grid objects?

Thanks,

-Nick
Nick
Monday, March 13, 2006
I personaly would keep the existing grid just do document.getElementById("ViewDiv").innerHTML=objGrid

That way you don't need to remake the grid each time.

I would presume the resize thing can be replaced like with other events never done that my self so can't comment (sure someone else has though)
J
Tuesday, March 14, 2006
Nick,

you can get access to the global reference array as Active.System.all, index is object id, and

obj === Active.System.all[obj.getId()];

If you create new AW objects in a loop - you should clean up the references from Active.System.all
Alex (ActiveWidgets)
Wednesday, March 15, 2006

This topic is archived.


Back to support forum

Forum search