jQWidgets Forums
jQuery UI Widgets › Forums › General Discussions › How to set keyboard focus to widget
Tagged: keyboard focus
This topic contains 5 replies, has 3 voices, and was last updated by lpf 12 years, 9 months ago.
-
Author
-
How do I set keyboard focus for a widget?
Thanks in advance
Best regards
Soeren DalbyHi Soeren Dalby,
You can use the jQuery’s focus method to set the focus to a widget or any other HTML element.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
I tried
$(‘#jqxTree’).focus();
after tree creation (in document.ready) but it did not have any affect.
Hi,
I have a similar (re)quest.
The closest I can get to giving a widget, like a grid, the keyboard focus
programatically is to get a grid row highlighted:
either
1) through a “selectrow” selection method
$(“#jqxgrid1”).jqxGrid(‘selectrow’, ‘0’);
or
2) though throwing a “mousedown” event at it.
(createEvent/initMouseEvent/dispatchEvent)However, only the/a row is highlighted. The grid though responding and
showing the row highlighted, it has not gained the keyboard focus.
Looks like it has because of the successfully highlighted row, but it
doesn’t. Adding “mouseup” and/or “click” events doesn’t seem to
get any further.Applying $(‘#anyjqxWidget’).focus(); has not for me supplied
keyboard focus to the widget either.The only way so far, I have been able to bring keyboard focus
to the/a widget, in my case a grid widget, is to actually physically
click into the grid. I have not yet been able to find a way to
bring keyboard focus programatically to the widget, for the
purposes of saving the user an unnecessary click, and over
time, many of them.It would be extremely useful to find/have this functionality.
Thank you,
-LeeYes, my intention was to implement a TAB-handler. We are so close to giving the user a desktop environment expericence in a browser with these cool widgets, so it is sad, that this is not possible.
Having to click each widget is however not desktop environment expericence. We must hope they get there soon
/Soeren
My “focus”, so to speak, is as yours to bring the user
more of a desktop environment experience within the browser,
and these widgets go a long ways in that direction, which is
what attracted me to them. These widgets required insight
and a lot of work. So, I as well hope we can get this additional
keyboard focus functionality added/discovered.-Lee
-
AuthorPosts
You must be logged in to reply to this topic.