feature: pressing enter on filter box causes browser go to link

feature: pressing enter on filter box causes browser go to link

don_jarodon_jaro Posts: 2Questions: 0Answers: 0
edited April 2009 in General
I use DataTables to list all items of specific type. Each item name is also link to details page. When user looks for specific item, he can filter another items out by entering item name in filter box.

It would be great, if pressing enter in filter box will cause activating link to details page, if table contains only one record.
For now, user has to enter item name in filter box and use mouse pointer to go to item details. Pressing enter would be much faster and easier...

Replies

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin
    Sounds easy enough to do with a 'keydown' event handler. What you could do is apply a 'keydown' handler tot he text box which will detect the return key, then check with DataTables if there is only one record in the table - if so - follow the link :-)

    Give me a shout if you need more or a starting point.

    Regards,
    Allan
  • don_jarodon_jaro Posts: 2Questions: 0Answers: 0
    Allan,
    Thanks for your reply.
    That seems to be quite easy and I think, I'll manage to do it ;)

    ~Jaro
This discussion has been closed.