JQuery DataTables multi-selection handling

JQuery DataTables multi-selection handling

philip06philip06 Posts: 1Questions: 1Answers: 0
edited July 2014 in Free community support

I currently have a Database displayed via JQuery's DataTables. I was able to get full functionality with the selection of only one row per request, but now the user needs to be able to select as many as he/she wants. I am using fnGetSelectedData() in the function that runs everytime a row is selected. However, this only returns the data of the first selected item.

The code used to handle row selection:

$('#title_select_table tbody').on( 'click', 'tr', function () {
        //$(this).toggleClass('selected');
            var id = this.id;
            var oTT = TableTools.fnGetInstance( 'title_select_table' );
            var aData = oTT.fnGetSelectedData();
            ajax('selectMediaItem?selected=' + JSON.stringify(id), [], ':eval');
            ajax('testPrint?upc=' + JSON.stringify(aData[0]['upc']), [], ':eval');
      } );

Any help or tips would be much appreciated.

This discussion has been closed.