EasyUI Forum
April 28, 2024, 02:13:41 PM *
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 Hide and show accordian panel on radio button input  (Read 8126 times)
dj_niv
Newbie
*
Posts: 7


View Profile
« on: November 02, 2014, 10:30:09 PM »

Hello ,

I have accordian and in the accordian panel. i have to hide/show accordian panel on radio button input
is there any property to for that to hide and add at particular index with title.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 03, 2014, 12:01:30 AM »

You can extend the 'showPanel' and 'hidePanel' methods to show or hide an accordion panel.
Code:
<script type="text/javascript">
$.extend($.fn.accordion.methods, {
hidePanel:function(jq, which){
return jq.each(function(){
var p = $(this).accordion('getPanel',which);
p.panel('close').panel('header').removeClass('accordion-header');
$(this).accordion('resize');
});
},
showPanel:function(jq, which){
return jq.each(function(){
var p = $(this).accordion('getPanel',which);
p.panel('open').panel('header').addClass('accordion-header');
$(this).accordion('resize');
});
}
})
</script>

Usage example:
Code:
$('#aa').accordion('hidePanel', 1);  // hide the second accordion panel
$('#aa').accordion('showPanel, 1);  // show the second accordion panel again
Logged
dj_niv
Newbie
*
Posts: 7


View Profile
« Reply #2 on: November 03, 2014, 01:55:42 AM »

Hi, stWorthy,

Its working thanks for your suggestion .
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!