0

How to apply both events click and double click on a single selected table row 'tr', where tr is dynamically bound with foreach knockout binding.

On single click it should call one function, on double click it should call another function.

Can any one help?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
nikhil
  • 203
  • 1
  • 10
  • post some code. or put up a fiddle. it'd be easier that way. – rgin Aug 30 '13 at 02:54
  • 1
    http://stackoverflow.com/questions/6330431/jquery-bind-double-click-and-single-click-separately – Parfait Aug 30 '13 at 02:58
  • 1
    see this too:: http://stackoverflow.com/questions/5471291/javascript-with-jquery-click-and-double-click-on-same-element-different-effect – Sudhir Bastakoti Aug 30 '13 at 02:59
  • 1
    Use dblclick in jquery. Refer http://api.jquery.com/dblclick/ – Manu M Aug 30 '13 at 04:39
  • Thanks you.... it works fine but i need something more like knockout if possible.... i can use this instead... anyways ... it was a great help... thanks again – nikhil Aug 30 '13 at 12:54
  • 1
    Here is the answer http://stackoverflow.com/questions/6330431/jquery-bind-double-click-and-single-click-separately – NoWar Jun 10 '14 at 14:08

1 Answers1

2

The general idea should be to put a timer after the first click and if another click was not detected, call the singleclick() function.

rgin
  • 2,291
  • 4
  • 24
  • 32