EasyUI Forum
September 15, 2025, 08:16:41 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: get parent object [solved]  (Read 7835 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: May 12, 2013, 11:18:25 PM »

How can I EASILY (without having to manually traverse up the DOM) get the parent easyui.object ?

Examples:

1. How can I get the parent pagination object of a datagrid object ?
2. if I have a button in the pagination or tool bar how can I get the datagrid object which is it's parent ?

Thanks
« Last Edit: May 15, 2013, 03:34:16 AM by devnull » Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 13, 2013, 12:36:39 AM »

No built-in methods can be used to find the component's parent object. To get the datagrid object from a linkbutton, you will have to get the pagination object then datagrid object.
Code:
var btn = $('#btn');  // the linkbutton in pagination
var pg = btn.closest('div.pagination');  // get the pagination object
var dg = pg.prevAll('div.datagrid-view:first').children('table');  // get the datagrid object
dg.datagrid('...');  // call some methods
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!