EasyUI Forum
April 29, 2024, 11:00:29 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to set focus on datagrid  (Read 4941 times)
pratikk
Newbie
*
Posts: 49


View Profile Email
« 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.

« Last Edit: January 26, 2019, 11:08:56 PM by pratikk » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 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');
Logged
pratikk
Newbie
*
Posts: 49


View Profile Email
« Reply #2 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
« Last Edit: January 27, 2019, 02:22:48 AM by pratikk » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 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.
Logged
pratikk
Newbie
*
Posts: 49


View Profile Email
« Reply #4 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.   
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!