jQWidgets Forums

jQuery UI Widgets Forums General Discussions How to set keyboard focus to widget

This topic contains 5 replies, has 3 voices, and was last updated by  lpf 12 years, 9 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • How to set keyboard focus to widget #7020

    sdalby
    Member

    How do I set keyboard focus for a widget?

    Thanks in advance

    Best regards
    Soeren Dalby

    How to set keyboard focus to widget #7030

    Peter Stoev
    Keymaster

    Hi 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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    How to set keyboard focus to widget #7047

    sdalby
    Member

    Hi Peter,

    I tried

    $(‘#jqxTree’).focus();

    after tree creation (in document.ready) but it did not have any affect.

    How to set keyboard focus to widget #7143

    lpf
    Member

    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,
    -Lee

    How to set keyboard focus to widget #7153

    sdalby
    Member

    Yes, 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

    How to set keyboard focus to widget #7157

    lpf
    Member

    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

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.