row hide / show details

row hide / show details

Phil HPhil H Posts: 20Questions: 0Answers: 0
edited July 2010 in General
Hi Allan,

Is it possible to create a button that opens all rows or close all rows ?. I have an application that uses this feature (sort of like a forum) and have been asked if all the rows can be opened so that a print out would contain the full list of messages

Many thanks in advance
Phil

Replies

  • Phil HPhil H Posts: 20Questions: 0Answers: 0
    Hi there,

    Just looking through all the posts I see an example that may do what I need

    [code]
    $(oTable.fnGetNodes() ).each( function () {
    $(this).click( function () {
    /* deselect and close all currently open rows */
    $(oTable.fnGetNodes()).each( function () {
    $(this).removeClass('row_selected');
    oTable.fnClose( this );
    });

    /* Open this row */
    $(this).addClass('row_selected');
    oTable.fnOpen( nTr, fnFormatDetails(nTr), 'details' );
    } );
    } );
    [/code]

    My question is how would I attach a routine like this to a 'open all' and 'close all' button

    Many thanks
    Phil
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi Phil,

    Have a look at my download page which does something like what you are looking for: http://datatables.net/download . Combine with Visual Event and you won't even need to 'view source': http://www.sprymedia.co.uk/article/Visual+Event :-)

    Allan
  • Phil HPhil H Posts: 20Questions: 0Answers: 0
    Hi Allan,

    That was exactly what was needed, works a dream

    Many thanks
    Phil
This discussion has been closed.