EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
January 24, 2026, 01:42:02 AM
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
>
General Discussion
>
can not remove accordion panels once complete?
Pages: [
1
]
« previous
next »
Print
Author
Topic: can not remove accordion panels once complete? (Read 14525 times)
cdtuql
Newbie
Posts: 26
can not remove accordion panels once complete?
«
on:
December 10, 2014, 09:47:17 PM »
thepanels=$('#layout_west_accordion').accordion('panels');
for (var i=0;i<thepanels.length;i++)
{
var index = $('#layout_west_accordion').accordion('getPanelIndex', thepanels
);
$('#layout_west_accordion').accordion('remove', index);
}
我在动态产生accordion的panels前,把原来的删除掉,为什么循环一次删除不完呢,这个代码执行了3次才行,为什么,怎么解决?
Logged
jarry
Administrator
Hero Member
Posts: 2305
Re: can not remove accordion panels once complete?
«
Reply #1 on:
December 11, 2014, 06:35:29 PM »
To remove all the accordion panels, please try the code below:
Code:
var thepanels=$('#layout_west_accordion').accordion('panels');
while(thepanels.length){
$('#layout_west_accordion').accordion('remove', 0);
}
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...