ajax Loaded row details in datatable issue

ajax Loaded row details in datatable issue

shubham9039shubham9039 Posts: 4Questions: 2Answers: 0

Link to show my live test code:
I am trying this below script:


<tr class="odd">
  <td class="details-control" key-num="123456" key-count="741"></td>
  <td>Airi Satou</td>


function format ( rowData ) {
var div = $('<div/>')
    .addClass( 'loading' )
    .text( 'Loading...' );

$.ajax( {
    url: '/api/staff/details',
    data: {
        key_num: "123456", //key-num="123456"
        key_count: "741",  //key-count="741"
    dataType: 'json',
    success: function ( json ) {
            .html( json.html )
            .removeClass( 'loading' );
} );

return div;

Error messages are shown:
not working
Description of problem:
I am coding on basis of this page link documentation "https://datatables.net/blog/2017-03-31", I am trying to send the data when ajax call, as "key_num & key_count" that are in the "table > tr > td" own attribute's.
How do I get the "td attr" value and send it to ajax to fetch the expected value from server

Sign In or Register to comment.