EasyUI Forum
May 05, 2024, 09:00:48 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: onClickCell of subgrid  (Read 5485 times)
JPi
Newbie
*
Posts: 18


View Profile Email
« on: November 01, 2016, 05:31:11 AM »

Hi,

I am using detailview for subgrid layout of my table. I have a button within the subgrid and on click of it, attachment should open pertaining to that row of subgrid. However I always get index as 0 inspite of clicking any other row.

Can you pls help with code of button within subgrid that will help me find the parent row index ?

Thanks,
JPi
« Last Edit: November 01, 2016, 10:38:16 AM by JPi » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 01, 2016, 08:07:39 AM »

Please call the 'getParentRowIndex' method to get the index of parent row.
Code:
onExpandRow: function(index,row){
    var ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
    ddv.datagrid({
        onClickCell: function(){
        var parentDg = $(this).datagrid('getParentGrid');
        var parentIndex = $(this).datagrid('getParentRowIndex');
        }
    }
}
Logged
JPi
Newbie
*
Posts: 18


View Profile Email
« Reply #2 on: November 01, 2016, 10:39:31 AM »

Thanks Stworthy ! I shall try out and get back to you.
Logged
JPi
Newbie
*
Posts: 18


View Profile Email
« Reply #3 on: November 02, 2016, 09:18:45 PM »

Thanks ! It works fine.
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!