Setting visible rows selected

Setting visible rows selected

WakaruWakaru Posts: 13Questions: 5Answers: 0

Hi,

Is there an option to set all visible row's status to selected (ie. <tr class "selected"> for the each of the row) while rendering the datatables? I already have the "Select all" button and that works fine, but I really need to get those rows to be selected as a default option.

Thanks!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Answer ✓

    You just want to add a class, or are you using a row selection plug-in such as TableTools. To add a class you could use the rows() method like: table.rows( { page: 'current' } ).nodes().to$().addClass( 'selected' );.

    Allan

  • WakaruWakaru Posts: 13Questions: 5Answers: 0

    Table Tools worked for me:

    var oTT = TableTools.fnGetInstance( 'example' );

    oTT.fnSelectAll();

    Thanks!

This discussion has been closed.