Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82828

Use row-selector on hidden column with ID numbers from database

$
0
0

I have a table that is generated through an ajax call. In my database I have a column of ID numbers, but I don't display them in the table because they aren't useful to the user...but I want to use them for being able to select/deselect certain rows from a button.

fiddle: http://jsfiddle.net/crashvector/q6af23y9/

The ID column visibility is set to false

{
        title: 'ID',
        'className': 'dt-left',
        'visible': false,
        data: 'ID'
      },

I was hoping to be able to use https://datatables.net/reference/type/row-selector by passing an array of ID numbers to it in the example.

{
      text: 'Select Default Library 1',
      action: function (e, dt, node, conf) {
        alert('This button will automatically check all rows that match predefined list 1 using the hidden ID column. (IE ID 4, 7, 8)');

      }
    }

I'm just not sure how to trigger the row selection for that specific column via the button in a way that allows the on.select/deselect functions to work.


Viewing all articles
Browse latest Browse all 82828

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>