Make row/cell clickable

Make row/cell clickable

naakheelnaakheel Posts: 1Questions: 0Answers: 0
edited July 2011 in General
I tried $('#example tbody td').click & $('#example tbody tr').click both do not seem to work.
I m loading the datatable with JSON thru Ajax using fnServerData.

Replies

  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    if you call $('#example tbody td').click() BEFORE you load the data, the data that is added after does not have the event handler associated with it.

    if you use $('#example tbody td').live(), even if the data comes later, live() will make sure to add the event handlers to them.
This discussion has been closed.