how to add pre-selected rows into select.info ?

how to add pre-selected rows into select.info ?

elevenpathelevenpath Posts: 3Questions: 1Answers: 0
edited April 2016 in Free community support

I use "createRow" callback to select a row:

              "createdRow": function( row, data, dataIndex ) {
                    if ( data.quantity > 0 ) {
                                $(row).addClass('selected');
                                $(row).select();
                         }
              },

it all works fine, except one thing: the select.info at left-bottom, which usually indicates how many row selected, doesn't add those pre-selected rows.

when I click a row afterwards, the select.info shows: "1 row selected". (I've set select to be multiple).

is there anyway that I can manually change the select.info's value?

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 62,114Questions: 1Answers: 10,185 Site admin
    Answer ✓

    Don't use jQuery / DOM to select the rows, use the row().select() method. i.e. in this case simply have table.row( row ).select();

    Allan

  • elevenpathelevenpath Posts: 3Questions: 1Answers: 0

    Thank you very much.

This discussion has been closed.