EasyUI Forum
September 23, 2020, 12:01:29 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: Accordion panel header text  (Read 6224 times)
dion
Newbie
*
Posts: 3


View Profile
« on: November 20, 2014, 12:47:07 AM »

Hi,

How do I do the following, but instead of returning the panelIndex, I need the panel header text

var p = $('#aa').accordion('getSelected');
if (p){
   var index = $('#aa').accordion('getPanelIndex', p);
   alert(index);
}

Regards,
Dion
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3575


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

Once you get the panel object, you can get all the options by calling the 'options' method.
Code:
var p = $('#aa').accordion('getSelected');
if (p){
  var title = p.panel('options').title;
  alert(title);
}
Logged
dion
Newbie
*
Posts: 3


View Profile
« Reply #2 on: November 20, 2014, 01:46:13 AM »

Thanks for the prompt reply. Where do I get more internal info like "...you can get all the options by calling the 'options' method". Do I need to do jQuery tutorials(as yet, my repertoire does not include much java, but I see and understand the object orientation.) I end up trying to guess some of the properties and methods. I have looked at the documentation, and I am either blind or this info was not there.

Cheers.
Logged
phunksta
Jr. Member
**
Posts: 53


View Profile Email
« Reply #3 on: November 20, 2014, 04:15:33 AM »

I end up trying to guess some of the properties and methods. I have looked at the documentation, and I am either blind or this info was not there.

Hi, I admit it takes a while, but the documentation does have this stuff. After staring at it over a few weeks it started to make a lot more sense.
I have also found it useful to actually go into the easyui code in some places, especially to see when event handlers are called.

I too started with very little javascript and jQuery but I'm getting it slowly! I still need stworthy to point out the best way quite often though!
Logged
dion
Newbie
*
Posts: 3


View Profile
« Reply #4 on: November 20, 2014, 08:21:15 AM »

Thanks.
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!