EasyUI Forum
May 07, 2024, 12:02:46 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Expanding Row - Mark the row as selected  (Read 6478 times)
brettjw
Newbie
*
Posts: 4


View Profile
« on: October 17, 2013, 08:19:28 AM »

Hello,

I am using the EasyUI for the first time and I have to say it is very powerful and easy to implement. I have been battling with an issue - it can get a little confusing for the end user when they have a row selected and expand a different row. You end up with a row in Yellow and the expanded row not highlighted at all. I have been trying to modify the datagrid-detailview.js file to accomplish this, but have not been able to grab the row to set the class (.addClass(datagrid-row-selected)) from the .expandRow function and reverse it from the .collapseRow call. If you could point me in the right direction that would be most appreciated. I think it would be a great modification to have out of the box as it makes for a less confusing UI Grid.

Thanks Again!

brettjw
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 17, 2013, 06:42:29 PM »

To select a row after expanding it, call 'selectRow' method in 'onExpandRow' event.
Code:
$('#dg').datagrid({
  onExpandRow:function(index){
    $(this).datagrid('selectRow',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!