Drilldown not displaying details row

Drilldown not displaying details row

jasonaleskijasonaleski Posts: 7Questions: 0Answers: 0
edited December 2013 in DataTables 1.9
I have a drilldown that I cannot get the details row to show. Below is a video and code. I've tried using different techniques to get the details to show, but no luck.

Screencast
http://screencast.com/t/LAwkJ7jvQQ73

Code
http://live.datatables.net/ireruh/edit#javascript,html

Suggestions?

Replies

  • allanallan Posts: 63,493Questions: 1Answers: 10,470 Site admin
    The code isn't running I'm afraid. Can you please link to a test case showing the issue so I can debug it. I'm not sure what the issue is from just the code I'm afraid, we need the feed as well.

    Allan
  • jasonaleskijasonaleski Posts: 7Questions: 0Answers: 0
    Here is the link. I had to modify the JSON feed to a TXT file. http://divops.com/datatables/
  • jasonaleskijasonaleski Posts: 7Questions: 0Answers: 0
    FYI, I have made some changes on the link above, but still no luck.
  • jasonaleskijasonaleski Posts: 7Questions: 0Answers: 0
    Can anyone provide any insight on this? I still cannot make the detail records show. I cannot see my error.
  • jasonaleskijasonaleski Posts: 7Questions: 0Answers: 0
    edited December 2013
    I finally got this working with the following adjustments:
    [code]

    var oTable;

    function fnFormatDetails(nTr){
    var aData = oTable.fnGetData(nTr);

    var sOut = ''+
    ''+
    'Location Information'+aData.SONBR+''+
    ''+
    '';
    console.log("DETAILS: "+sOut);
    return sOut;

    }

    $(document).ready(function(){
    var sImageUrl = "includes/";

    oTable = $('#example').dataTable( {
    "bProcessing": true,
    "sAjaxSource": "json.php",
    "aoColumns": [
    { "mDataProp": null,
    "sClass": "control center",
    "sDefaultContent": ''
    },
    {"mDataProp": "SONBR"},
    {"mDataProp": "SODATE"},
    {"mDataProp": "SOTIME"},
    {"mDataProp": "SOFUNC"},
    {"mDataProp": "LOCNBR"},
    {"mDataProp": "DISNBR"},
    {"mDataProp": "CONNBR"}
    ]
    });
    console.log("STATUS: Data tables initialized.");

    $('#example tbody').on('click', 'td img', function () {

    var nTr = $(this).parents('tr')[0];
    console.log("VALUES: ntr = "+nTr);

    if (this.src.match('details_close.png')) {
    /* This row is already open - close it */
    console.log("CLICK: Close Details");
    this.src = sImageUrl+"details_open.png";
    oTable.fnClose(nTr);
    }else{
    /* Open this row */
    console.log("CLICK: Open Details");
    this.src = sImageUrl+"details_close.png";
    oTable.fnOpen(nTr, fnFormatDetails(nTr), 'details' );
    }
    });
    });

    [/code]
This discussion has been closed.