Double Click Function

Double Click Function

mykromomykromo Posts: 2Questions: 0Answers: 0
edited July 2012 in Bug reports
Hi Guys!

Good day!

I need your help and I'm new here. :)
I'm encountering weird problem when i created a double click function to get data of specific column.
first 10 row of data, when I double click to the row, it did the right thing that i want execute (Alert).
but when i click the next button and then do the same thing (Double Click) the function didn't work.

Can you help me with this? please.. thanks!

Here's the code.

[code]
$(document).ready(function() {
/* Init the table */
var oTable = $('#example').dataTable( );

$('#example tr').dblclick(function() {
var aPos = oTable.fnGetPosition(this);
alert(aPos);
});
});
[/code]

God bless you!

Best regards,

Myk

Replies

  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    edited July 2012
    This is expected behavior: you only assign the dbclick function to the current, existing trs. Pressing the 'Next' button will give you fresh trs, which do not have the function assigned.

    You may want to check this page out: http://api.jquery.com/live/
  • mykromomykromo Posts: 2Questions: 0Answers: 0
    Awesome.. Thanks! God bless you!
  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    Thanks!
This discussion has been closed.