EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: brettjw on October 17, 2013, 08:19:28 AM



Title: Expanding Row - Mark the row as selected
Post by: brettjw 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


Title: Re: Expanding Row - Mark the row as selected
Post by: stworthy 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);
  }
});