Close Open Details Rows When New Details Icon is Clicked

Close Open Details Rows When New Details Icon is Clicked

DavidBoomerDavidBoomer Posts: 21Questions: 0Answers: 0
edited May 2012 in DataTables 1.9
From the example: http://www.datatables.net/release-datatables/examples/api/row_details.html

Is it possible to only have one details row open at a time? The example allows multiple hidden rows to be open simultaneously.

Thanks, David.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Yup - I use exactly that technique in my Editor display controller tutorial: http://editor.datatables.net/tutorials/display_controllers . The "trick" is to find out if there are any open rows when you want to open a new row, and if so, close them.

    [code]
    var openRows = table.fnSettings().aoOpenRows;
    [/code]

    Allan
This discussion has been closed.