Events binding on elements in "details" pane do not work

Events binding on elements in "details" pane do not work

morthahnamorthahna Posts: 18Questions: 0Answers: 0
edited August 2010 in General
Hello,

I have some , and elements within the details row... I'm unable to bind any hover/click/whatever events on them... I read the FAQ and using fnDrawCallback/fnInitComplete works for all elements within the datatable but the details row.

[code]
/* Formating function for row details */
function fnFormatDetails ( nTr )
{
var aData = oTable.fnGetData( nTr );
sOut = ''+aData[8]+'';
sOut += ''+aData[7]+'test';
return sOut;
}
[/code]

What am I missing? Data comes from ajax source... Help is appreciated...!

Replies

  • morthahnamorthahna Posts: 18Questions: 0Answers: 0
    Sorry for pushing this, but...

    "I read the FAQ and using fnDrawCallback/fnInitComplete works for all elements within the datatable but the details row."

    @Allan: Can you reproduce the issue?
  • jeronejerone Posts: 12Questions: 0Answers: 0
    You probably have executed some code that adds hover/click events on every row. The problem is that your new html (sOut) is injected in the DOM when the details is opened. Those events will then not be added.
    The solution is to use the "live" eventhandler in jQuery: http://api.jquery.com/live/
  • kkudikkudi Posts: 77Questions: 0Answers: 0
    yes, jerone's suggestion should do the trick
    use live instead of bind or the event shortcut.
This discussion has been closed.