Collection with multiple selection

Collection with multiple selection

koko82koko82 Posts: 10Questions: 2Answers: 0

Hi,

I tried to found a solution to my problem but I didn't find anything in the forum or in the manual.
I never used a tabletools collection button so I'm a newbie for this topic.
In short I would like to give the possibility to select more choices at the same time.
Is it possible make this button with tabletools or I must create a new plugin?
Thanks a lot for the support and the framework.
Mirko

This question has an accepted answers - jump to answer

Answers

  • leddyleddy Posts: 16Questions: 5Answers: 1

    Do you want to have multi-select on the table? Like this?

    $('#example').DataTable({
                        tableTools: {
                            "sRowSelect": "multi",
                            "aButtons": ["select_all", "select_none"]
                        }
                    });
    
  • koko82koko82 Posts: 10Questions: 2Answers: 0
    edited May 2015

    Hi,

    no, I would like to create a collection like that

    $(document).ready( function () {
        $('#example').dataTable( {
            "sDom ": 'T<"clear ">lfrtip',
            "oTableTools ": {
                "aButtons ": [
                    {
                        "sExtends ":    "collection ",
                        "sButtonText ": "Save ",
                        "aButtons ":    [ "csv ", "xls ", "pdf " ]
                    }
                ]
            }
        } );
    } );
    

    and give the possibility to choose csv AND xls.
    BR
    Mirko

  • allanallan Posts: 48,908Questions: 1Answers: 7,133 Site admin
    Answer ✓

    You mean you don't want the collection list to close automatically when an item is selected? Or do you want to be able to save multiple files from a single click?

    Either way, an alteration would be required to the TableTools code. You wouldn't need to start again, and a plug-in button would do it. Have a look at how fnClick works for those buttons in the code if you do want to try it.

    Allan

This discussion has been closed.