Select All filtered

Select All filtered

picktracepicktrace Posts: 12Questions: 5Answers: 0
edited October 2013 in DataTables 1.9
Is there a simple way to have it when I click the select all button, to only select the results that are filtered? Or do I need to implement my own select all button?

Replies

  • picktracepicktrace Posts: 12Questions: 5Answers: 0
    Looks like implementing my own select button that calls fnSelectAll() is going to be my best option.

    arguments: boolean - Select only filtered rows (true). Optional - default false.
  • picktracepicktrace Posts: 12Questions: 5Answers: 0
    edited October 2013
    in case someone else stumbles across this post. Here's a better solution: http://www.datatables.net/forums/discussion/comment/47085

    You will need to change
    [code]
    "sExtends": "select"
    [/code]
    to
    [code]
    "sExtends": "select_all"
    [/code]
  • mecabmecab Posts: 9Questions: 2Answers: 0
    picktrace can you please tell me how to do this ? i tried it but it just doesn't work for me :/

    [code]

    $('#table_NRubriques').dataTable({
    ...
    "aButtons" : [
    {
    "sExtends": "select_all",
    "sButtonText": "Select Filtered",
    "fnClick": function (nButton, oConfig, oFlash) {
    var oTT = TableTools.fnGetInstance('table_main');
    oTT.fnSelectAll(true); //True = Select only filtered rows (true). Optional - default false.
    }
    },
    ...
    [/code]

    what did i do wrong here ? i can't find the issue :/
  • mecabmecab Posts: 9Questions: 2Answers: 0
    Well i solved it after all i just needed to change "table_main" to the id of my table wich is table_NRubriques
This discussion has been closed.