EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: pratikk on April 07, 2014, 01:17:17 AM



Title: How to set focus on datagrid lines
Post by: pratikk on April 07, 2014, 01:17:17 AM
I want to set focus on a selected line in datagrid


Title: Re: How to set focus on datagrid lines
Post by: stworthy on April 07, 2014, 07:36:24 AM
Try to get the row element, give it a 'tabindex' attribute, and then do a focus() on it.
Code:
$('#dg').datagrid({
onSelect:function(index,row){
var opts = $(this).datagrid('options');
var tr = opts.finder.getTr(this, index);
tr.attr('tabindex',0);
tr.focus();
}
})


Title: Re: How to set focus on datagrid lines
Post by: pratikk on April 07, 2014, 12:14:41 PM
Thank You . This solved my problem :)  This datagrid is realy flexible