How to set click event in DT_RowData in the server side using java

How to set click event in DT_RowData in the server side using java

mmadrigalmmadrigal Posts: 1Questions: 1Answers: 0

Hello everyone,

I'm trying to set an onclick event in each <tr> of my datatable, this is what I'm doing:

response.setDT_RowData("{ 'onclick' : \"reviewPurchaseOrder(this);\"}");

My response JSON looks like this:

{"sEcho":"1",
"iTotalRecords":1,
"iTotalDisplayRecords":2,"
data":[{"order":"PO-22-2016",
"DT_RowData":"{
\u0027onclick\u0027 : \"reviewPurchaseOrder(this);\"}",

"DT_RowId":"27080700723292166835522155310"
}]
}

This is my html:

<tr class="odd" role="row" id="27072580060722369635737438916"></tr>

The DT_RowId is working perfectly but I am not able to add the onclick event in each tr.

I really appreciate if somebody can give me clue about how to achieve this.

This discussion has been closed.