How to have select all to respect filters

How to have select all to respect filters

mrd05dmrd05d Posts: 45Questions: 6Answers: 3

Since select all is a Text button it does not seem to follow oSelectorOpts below:

"oSelectorOpts": {
"page": 'all',
"filter":'applied'
}

How can I go about making sure that when I have a filter on that the select all button (or any text button for that matter) only selects rows that are currently in filtered dataset?

Answers

  • mrd05dmrd05d Posts: 45Questions: 6Answers: 3

    Wow i feel silly...

    I fixed this easily by extending the button and using fnSelectAll:

        var tt = new $.fn.dataTable.TableTools( table, {
            
        "sSwfPath": "DataTables/extensions/TableTools/swf/copy_csv_xls_pdf.swf",
        "sRowSelect": 'os',
        "aButtons": [
        {
        "sExtends":"select_all",
        "sButtonText": "Select All",
        fnClick:function(nButton, oConfig, oFlash){
        tt.fnSelectAll(true);
        }
        ]
        });
    
This discussion has been closed.