Single/Double Click loads new page

Single/Double Click loads new page

tdktank59tdktank59 Posts: 28Questions: 0Answers: 0
edited April 2009 in General
First off GREAT plug in for jquery! Simple, and easy to use. also the best looking one at that!

So onto the subject
Just wondering if there is a way to have a single or double click on a row to load a new page.

for example Ive got a grid of users. When you single click on them it brings you to their profile. However if you have the access to do so double click will let you modify their profile.

I'm going to guess I could use the click detection stuff, and within that little function have it redirect to a page or something. But id like to get your input on it.

Replies

  • allanallan Posts: 63,491Questions: 1Answers: 10,470 Site admin
    Hi tdktank59,

    Thanks very much for the compliments about DataTables! :-)

    What you need to do to achieve what you are looking for here, is to bind the relevant event handlers to your table rows. I've got two examples for this, pre- and post- initialisation:

    http://datatables.net/examples/example_events_pre_init.html
    http://datatables.net/examples/example_events_post_init.html

    Also double click detection can be done with jQuery's dblclick bind helper:

    http://docs.jquery.com/Events/dblclick#fn

    Hope this helps!
    Allan
This discussion has been closed.