EasyUI Forum
May 02, 2024, 06:29:51 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: Expand by Clicking on Row  (Read 7357 times)
KennyD
Newbie
*
Posts: 2


View Profile Email
« on: March 27, 2014, 03:18:51 AM »

Hi.

I'm using the following code to expand rows in my datagrid table:
http://www.jeasyui.com/tutorial/datagrid/datagrid21.php

Now, I've been searching without any luck. I've been looking through the Javascript files too, but haven't been able to achieve this.

Instead of clicking the plus (+) and minus (-) images in the left side of the rows I want to click the entire row and expand as normal. I've been looking at Stackoverflow and these very forums without any luck.

I found something about expanding on header click, but I don't think that's the right thing.

Can someone please point me in the right direction and maybe even show me where the code is placed in the javascript file jquery-easyui.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: March 27, 2014, 06:42:58 AM »

When click a row, the 'onClickRow' event fires, in which you can call 'expandRow' method to expand the detail panel.
Code:
$('#dg').datagrid({
  onClickRow: function(index,row){
    $(this).datagrid('expandRow', index);
  }
});
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!