KeyTable focus on input

KeyTable focus on input

kgriggskgriggs Posts: 6Questions: 1Answers: 0
edited October 2013 in KeyTable
Hello

I have a table (not a datatable) that has some values that are strings and some are inputs. I would like to use KeyTable to provide arrow navigation between the inputs and not the strings - so arrowing around should skip the tds without inputs. I would also like the inputs to come into focus when a users tabs/arrows to that td.

Is this possible. Can you point me in the right direction?

Here is an example: http://jsfiddle.net/HRVL7/1/

Note: I am using jquery 1.9 and the current dev version of KeyTable from git.

Thanks!

Replies

  • kgriggskgriggs Posts: 6Questions: 1Answers: 0
    Actually - skipping the tds without inputs is not necessary. But I would like to set the first td with an input to be the one that starts with the focus.
  • kgriggskgriggs Posts: 6Questions: 1Answers: 0
    Solved the focus issue:
    var keys = new KeyTable( {
    "table": document.getElementById('datatable'),
    "focus": $('.classofTDtoFocus')[0]
    } );
  • kgriggskgriggs Posts: 6Questions: 1Answers: 0
    Solved the input issue:
    keys.event.focus( null, null, function() {
    $(keys.fnGetCurrentTD()).children('.classofinput').focus();
    } );
This discussion has been closed.