EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: peter on April 07, 2014, 01:32:31 AM



Title: Datagrid hover
Post by: peter on April 07, 2014, 01:32:31 AM

I would like to take an action when the mouse hovers over a grid line. Is there any way to do this?
If so, how would I be able to tell which line the mouse was hovering over?


Title: Re: Datagrid hover
Post by: stworthy on April 07, 2014, 07:22:36 AM
You can bind 'mouseover' event to each rows when loaded data successfully.
Code:
	$('#dg').datagrid({
onLoadSuccess:function(){
$(this).datagrid('getPanel').find('tr.datagrid-row').bind('mouseover',function(e){
var index = parseInt($(this).attr('datagrid-row-index'));
console.log(index);
})
}
})