EasyUI Forum
May 09, 2024, 01:57:58 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: accordion onselect/onunselect  (Read 3985 times)
roberto
Jr. Member
**
Posts: 88


View Profile Email
« on: August 09, 2017, 07:52:07 PM »

hi,
I have an accordion control. I don't want to let the user close all panels. If he close the last one I want to select the next or the previous, but I can't find how to know if the unselected panel is the last opened.
Is it possible?
tks,
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: August 11, 2017, 12:15:50 AM »

You can call 'panels' method to get all the accordion panels. Retrieve the 'collapsed' property of a panel to check if the panel is collapsed.
Code:
var panels = $('#aa').accordion('panels');
for(var i=0; i<panels.length; i++){
  var p = panels[i];
  var collapsed = p.panel('options').collapsed;
  console.log(collapsed)
}
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!