EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: aswzen on July 09, 2014, 07:43:50 PM



Title: Select onHover on easyUI datagrid
Post by: aswzen on July 09, 2014, 07:43:50 PM
i think it would be great if onHover method is exist on easyUI datagrid...
or i just missed it?

example..how to make we just selected the data when our cursor hovering them..?

:)


Title: Re: Select onHover on easyUI datagrid
Post by: stworthy on July 10, 2014, 04:28:07 AM
No 'onHover' event exists in datagrid plugin. You have to achieve this functionality manually, please try the code below:
Code:
$('#dg').datagrid({
  onLoadSuccess:function(){
    var target = this;
    var opts = $(target).datagrid('options');
    opts.finder.getTr(target,0,'allbody').each(function(){
      $(this).bind('mouseenter',function(){
        $(target).datagrid('selectRow', $(this).attr('datagrid-row-index'))
      })
    })
  }
})