fnGetData return undefined

fnGetData return undefined

michaelhnmichaelhn Posts: 2Questions: 2Answers: 0
$(document).ready(function() {
                var table = $('#request-table').dataTable({
                    "scrollX": true,
                    "sAjaxSource": "/somuploader/request/listRequestJSON",
                    "columns": [
                        {
                            data: null,
                            className: "center",
                            defaultContent: '<input id="viewBut" type="button" class="btn-warning editor_edit" onclick="alert()" value="Lihat" />  \n\
                                 <input type="button" class="btn-danger editor_remove" onclick="deleteIfPossible()" value="Delete"/>'
                        },
                        {"data": "reqNo"},
                        {"data": "reqDate"},
                        {"data": "reqBatchNo"},
                        {"data": "reqClId"},
                        {"data": "reqBatchDescription", "width": "30px"},
                        {"data": "reqStatus"}
                    ],
                    "columnDefs": [{
                            "targets": -1,
                            "data": null,
                            "defaultContent": "<button>Click!</button>"
                        }]
                });
                $('body').on('click', 'tbody tr', function() {
                    alert('Position: ' + table.fnGetData(this)[0]);
                });

            });

what I did wrong?thanks

This discussion has been closed.