EasyUI Forum
September 13, 2025, 04:47:06 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to destroy treeGrid component  (Read 11034 times)
amir-t
Newbie
*
Posts: 48


View Profile
« on: August 06, 2014, 10:10:00 AM »

Hi,

i'm using Tree-grid in chrome browser.
In our page, we're using a dynamic panel which can switch between views of treeGrids.

We noticed that we have a serious problem of memory leaks -
After we created many views of treeGrid (where each new view in our manager panel creates a new instance of the TreeGrid component)
and then removing all the existing views, the memory usage of the chrome process is not released and gets higher even more when we create & remove another views afterward.

Our need is to dispose and destroy the TreeGrid component when removing or changing a TreeGrid view.
How can we destroy all the treeGrid's related DOM components and all its inner objects (columns, rows, editors, headers etc..)
and to avoid from memory leaks or undisopsed treeGrid's inner objects\components?
 
Thanks in advance.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: August 06, 2014, 07:53:31 PM »

Please try the code below to destroy a treegrid component.
Code:
$('#tg').treegrid('getPanel').panel('destroy');
Logged
amir-t
Newbie
*
Posts: 48


View Profile
« Reply #2 on: August 12, 2014, 02:10:14 AM »

Hi, thanks a lot for your reply.

I've tried the above code, it indeed removed the treegrid's panel and inner divs from the DOM,
but for some reason the tab process's memory usage still growing on every creation\removal view of treeGrid.
We tried to create treeGrid and destroy it directly 10 times, and in each iteration the memory just got bigger as like the previous treeGrid's resources weren't destroyed nor released from the memory.

Is the above code (panel destroy) supposed to remove all the inner objects and resources of the treeGrid from memory?
Is there some 'jsfiddle' example of destroying treeGrid where we can test and monitor the memory leaks problem and make sure the above code works properly?

Thanks in advance.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!