How to call Datatable csv button from custom button

前端 未结 4 1959
攒了一身酷
攒了一身酷 2021-01-02 13:34

Need to call csv button from my custom button.

4条回答
  •  礼貌的吻别
    2021-01-02 14:27

    dataTables export buttons is by default enriched with signature classes like .buttons-excel, .buttons-pdf, .buttons-csv and so on. Take advantage of that :

    $('#ExportReporttoExcel').on('click', function() {
      $('.buttons-excel').click()
    });
    

提交回复
热议问题