EasyUI Forum
June 28, 2024, 05:15:40 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: the DOM of datebox panel DO NOT release  (Read 12037 times)
zhenghacn
Newbie
*
Posts: 7


View Profile Email
« on: September 03, 2014, 10:16:57 PM »

I have a issue for DOM object release.

my index.html as following

<body>
    <div id="content_area">
        <div id="workspace"> </div>
    </div>


the working page will load into workspace as following code:
$("#workspace").load("newdatebox.html", null, function(){$.parser.parse("#workspace");});

Fox example, there is a datebox in newdatebox.html

Once load newdatebox.html, there will generate a DOM object in root of DOM tree which class is "panel combo-p", and this DOM will be never released. this means, there will be couple of "panel combo-p" DOMs after repeated load newdatebox.html.

please help me figure out the reason and fix this issue.

The code and snapshot for DOM tree please refer to attachment.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 04, 2014, 12:49:17 AM »

Please try to use the 'refresh' method of panel to load external page.
Code:
<div id="workspace" class="easyui-panel"> </div>
Code:
$('#workspace').panel('refresh','newdatebox.html');
Logged
zhenghacn
Newbie
*
Posts: 7


View Profile Email
« Reply #2 on: September 05, 2014, 01:23:02 AM »

It works, thanks a lot.


Please try to use the 'refresh' method of panel to load external page.
Code:
<div id="workspace" class="easyui-panel"> </div>
Code:
$('#workspace').panel('refresh','newdatebox.html');
Logged
zhenghacn
Newbie
*
Posts: 7


View Profile Email
« Reply #3 on: September 10, 2014, 01:19:13 AM »

hi stworthy,
i met another problem, the DOMs which class="panel window" and class="window-shadow" will not be released automatically when the panel is refreshed.

i use following code as you mentioned:
$('#workspace').panel('refresh','xxx.html');

please give me suggestion. thanks a lot.

Please try to use the 'refresh' method of panel to load external page.
Code:
<div id="workspace" class="easyui-panel"> </div>
Code:
$('#workspace').panel('refresh','newdatebox.html');
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: September 10, 2014, 01:34:19 AM »

the DOMs which class="panel window" and class="window-shadow" will not be released automatically when the panel is refreshed.

Please describe your question in more detail.
Logged
zhenghacn
Newbie
*
Posts: 7


View Profile Email
« Reply #5 on: September 10, 2014, 06:46:03 PM »

Dear stworthy,
I attached the index.html and test.hmtl, there are only a easyui-dialog in test.hmtl.

if test.hmtl is loaded multiple times, the DOMs which class is "panel window" and "window-shadow" will be not released automatically, there will be many garbage DOMs in the root of DOM tree.

Please correct me the right way to use easyUI. Thanks a lot.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #6 on: September 10, 2014, 07:19:18 PM »

You have to destroy the dialog object manually.
Logged
zhenghacn
Newbie
*
Posts: 7


View Profile Email
« Reply #7 on: September 10, 2014, 07:36:13 PM »

is there no way to destory dialog object automatically or some workarround?

You have to destroy the dialog object manually.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #8 on: September 10, 2014, 08:26:29 PM »

You have to recognize what dialogs are loaded by yourself. You can add a 'cls' property to them, so that you can find them easily and do further operations for them.
Logged
zhenghacn
Newbie
*
Posts: 7


View Profile Email
« Reply #9 on: September 11, 2014, 07:22:03 PM »

Thanks for your response.
I think that does NOT make sense to handle Dialog. Could your team enhance the Dialog to use it easy?

You have to recognize what dialogs are loaded by yourself. You can add a 'cls' property to them, so that you can find them easily and do further operations for them.
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!