Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

How to have all checkboxes checked by default?

$
0
0

Hi,

I have a datatable using checkbox extension below and it works perfectly. However, I would need to have all checkboxes check when the datatable is initialized? Is it possible to do so? Is there easy function/method that I can use to get this?

I have the following code:

                    var myTable = $('#mytable').DataTable({
                      'data': result,
                      'paging': false,
                      'searching': false,
                      'columns': [
                         {
                            'data': 'ID',
                            'checkboxes': {
                              'selectRow': true
                            }
                         },
                         { 'data': 'Part_Number' },
                         { 'data': 'Part_Description' },
                         { 'data': 'Part_Type' },
                         { 'data': 'Part_Quantity' },
                         { 'data': 'Part_Price',
                           'render': $.fn.dataTable.render.number( ',', '.', 2, '$' )}
                      ],
                      'select':{
                            'style':'multi'
                        },
                      'order': [[1, 'asc']],
                    });

Thanks


Viewing all articles
Browse latest Browse all 2364

Trending Articles