Add export customize by default

Add export customize by default

geethunimeshgeethunimesh Posts: 25Questions: 9Answers: 0

How can I add export button and its customize function by default like this
$.extend($.fn.dataTable.defaults, {
language: {
"loadingRecords": "Loading. Please wait...",
"info": "Showing <span class='startPage'>START</span> to <span class='endPage'>END</span> of <span class='totalPage'>TOTAL</span> entries",
"lengthMenu": "Showing MENU entries"
},
});

Answers

  • geethunimeshgeethunimesh Posts: 25Questions: 9Answers: 0

    https://jsfiddle.net/t438mzLk/5/
    Here I can add default format for export. But how can I override this for a particular export?

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    I might be wrong, but your Fiddle already appears to show that. The default customize function is not being called - rather the replacement is.

    Allan

  • geethunimeshgeethunimesh Posts: 25Questions: 9Answers: 0

    Yes, The second one will replace the default. Is it possible to override some features?
    say, customize without replacing the entire button.

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Oh I see - try a deep extend:

    $.extend(true, $.fn.dataTable.defaults, { buttons: [{ 
    

    Allan

This discussion has been closed.