EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: pratikk on January 26, 2019, 04:29:52 AM



Title: How to set focus on datagrid
Post by: pratikk on January 26, 2019, 04:29:52 AM

I want to focus on  each element in the form by using tab and shift tab keys. But I can't get focus to datagrid.



Title: Re: How to set focus on datagrid
Post by: jarry on January 27, 2019, 01:26:02 AM
Set the 'tabindex' attribute for the datagrid panel.
Code:
var p = $('#dg').datagrid('getPanel');
p.attr('tabindex', 1).css('outline-style','none');


Title: Re: How to set focus on datagrid
Post by: pratikk on January 27, 2019, 02:15:52 AM
It's not getting focus to datagrid when I use tab keys. Nothing changed.  Only when I click on the datagrid , the striped lines get thr focus color which is yellow as seen on the picture


Title: Re: How to set focus on datagrid
Post by: jarry on January 27, 2019, 07:22:20 PM
Please look at this example http://code.reloado.com/izehaz4/edit#preview. Press tab key to focus on next textbox and then datagrid panel.


Title: Re: How to set focus on datagrid
Post by: pratikk on January 28, 2019, 12:44:26 PM
The reason why it didn't work is ; The tab key was restricted to focus on other than input fields. So I erased those lines and it is working. Thank you very much.