EasyUI Forum
May 12, 2024, 09:20:25 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: How to access content inside a panel?  (Read 11904 times)
tslatt
Jr. Member
**
Posts: 85



View Profile
« on: December 15, 2011, 10:00:46 AM »

I hope this is an easy one... Given a panel with ajax loaded content, how can I access the content within that panel? For example, a panel is returned from the onLoad event of a tab. I want to find a div inside that panel that has a class of "aportal" and get its id.

Code:
onLoad: function(p) {
  // what code can find this panel's (".aportal").attr("id") ?
}

Thank you for any help!!
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: December 15, 2011, 06:54:54 PM »

onLoad:function(){
  var id = $(this).find('.aportal').attr('id');
  alert(id);
}
Logged
tslatt
Jr. Member
**
Posts: 85



View Profile
« Reply #2 on: December 16, 2011, 08:35:07 AM »

Thank you so much! At first it didn't seem to work. It was finding the first instance of those classes on the page, not the instance within the specific panel. But, just changing "this" to "p" in your code worked!

onLoad:function(p){
  var id = $(p).find('.aportal').attr('id');
  alert(id);
}
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!