Jowin / Datatables-Bootstrap3

Plugin for Datatables Bootstrap3 UI Compatibility
215 stars 82 forks source link

TableTools collection buttons do not function #16

Open stevelippert opened 10 years ago

stevelippert commented 10 years ago

Given the following DataTables init I'm unable to click all of the options in the collection.

    var tableContainer = $(".dataTables");
    tableContainer.dataTable({
            "bPaginate"     : false,
            "bAutoWidth"    : false,
        "fnPreDrawCallback": function () {
            if (!responsiveHelper) {
                responsiveHelper = new ResponsiveDatatablesHelper(tableContainer, breakpointDefinition);
            }
        },
        "fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
            responsiveHelper.createExpandIcon(nRow);
        },
        "fnDrawCallback": function (oSettings) {
            responsiveHelper.respond();
        },
        "sDom"          : 'T<"clear"><"top"plf<"clear">>rt<"bottom"ipl<"clear">>',
            "oLanguage"     : {
            "sEmptyTable"   : "There are currently no students registered for this course.",
            "sLengthMenu"   : "Show: _MENU_",
            "sSearch"       : "Filter:",
            "sZeroRecords"  : "There are currently no students registered for this course."
            },
        "aoColumns"     :[
            {
                "sType"         :"title-string",
                "sWidth"        :"175px"
            },
            { "sWidth"          : "140px"   },
            { "sWidth"          : "75px"    },
            { "sWidth"          : "300px"   },
            { "sWidth"          : "100px"    },
            { "sWidth"          : "70px"    },
            { "sWidth"          : "200px"   },
            { "sWidth"          : "250px"   },
            { "sWidth"          : "175px"   }
        ],
        "aaSorting"     : [ [0,"asc"] ],
        "bAutoWidth"    : false,
        "oTableTools"   : {
            "aButtons"          : [
                {
                    "sExtends"  : "collection",
                    "sButtonText": "Export Student List <span class='caret' />",
                    "sButtonClass": "btn btn-default",
                    "aButtons"  : [
                        "csv",
                        "xls",
                        "pdf",
                        "print"
                    ]
                }
            ],
            "sSwfPath"  : "/codeExtra/datatables/1.9.4/copy_csv_xls_pdf.swf",
        }
        });

2014-02-18 15_01_10-student list

Hovering over "CSV" activates "PDF" (as shown above), and will produce a PDF file. Attempting to use Excel and PDF do not work at all. Hovering over Print, it does not go active. Also the warning modal for print does not appear as expected.

wunsjoshi commented 8 years ago

Hello @Stevelippert,

I have same issue. But one good thing is that after using your code I am able to properly display collection buttons for Export functionality.

Still issue stays that CSV, Excel, PDF are not working in Collection case.

Does anybody has solution?