Detail Popup window

Detail Popup window

ThalliusThallius Posts: 31Questions: 4Answers: 0
edited August 2013 in General
Hi,

I have a server-sided datatable which works fine. It displays a mysql data set which contains 30 data fields in each row. Because I cant show all 30 fields in the table (not enough place on the screen), I only show the first 5 data fields and I now want to show a popup detail window (div) when the user clicks on a tableview row which shows all the 30 data fields.
For this I first need the data from all 30 fields. I thought the easiest way would be to add the data to the server php script output and then get this output on the client and display my window from.
But I cant find out how to access the json data the data table received via Ajax. I also tried to use fnGetTds() but this only gives me the 5 columns. Mayby I must create invisible columns for the other 25 fields but I cant figure out how.

thanks for help

Claus

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Have you tried using fnGetData to get the data object for the row?

    Allan
  • ThalliusThallius Posts: 31Questions: 4Answers: 0
    edited August 2013
    I actually have th problem, that

    [code]
    $(document).ready(function() {
    oTable = $('#userTable').dataTable();

    oTable.$('tr').click( function ()
    {
    alert("Test");
    } );
    } );
    [/code]

    does not give me an alert anyway. What could be a reason why the click function ist not called?

    [code]
    $('#userTable tbody').click(function(event)
    {
    alert("Test");
    });
    [/code]

    works fine?

    Thanks

    Claus
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Possibly it hasn't be attached since that is a static event handler. Use delegated events:

    [code]
    $('#userTable tbody').on( 'click', 'tr', function () {

    } );
    [/code]

    Please link to a test case in future so we can say for sure: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    Allan
  • ThalliusThallius Posts: 31Questions: 4Answers: 0
    Thanks a lot.

    That looks fine. Now I get all fields with fnGetData().

    Claus
This discussion has been closed.