EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 17, 2024, 04:27:38 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
Why remove all nodes occur bug
Pages: [
1
]
« previous
next »
Print
Author
Topic: Why remove all nodes occur bug (Read 7227 times)
nyr_jack
Newbie
Posts: 31
Why remove all nodes occur bug
«
on:
October 29, 2012, 08:48:42 PM »
var roots = $('#targetTree').tree('getRoots');
for(var i = 0; i < roots.length; i++){
$('#targetTree').tree('remove',roots
.target);
}
Why occur bug with message '0.target is null or ...'
Logged
sphsyv
Newbie
Posts: 8
Re: Why remove all nodes occur bug
«
Reply #1 on:
October 29, 2012, 10:19:37 PM »
Quote from: nyr_jack on October 29, 2012, 08:48:42 PM
var roots = $('#targetTree').tree('getRoots');
for(var i = 0; i < roots.length; i++){
$('#targetTree').tree('remove',roots
.target);
}
Why occur bug with message '0.target is null or ...'
当你remove第一个后,这个roots的索引就改变了,所以会出错。
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...