(HTML5 export buttons) "Input fields" not export?

(HTML5 export buttons) "Input fields" not export?

BWHBWH Posts: 8Questions: 3Answers: 0
edited February 2017 in Free community support

Hello, everyone ?

https://datatables.net/extensions/buttons/examples/html5/simple.html

I implemented it using the link above.

"Input fields" not export?

I've debugged Chrome

//////////////////////////////////////////////////////////

//<td class=" grid_data_c">Test Export</td> <------export OK!
// <td class=" grid_data_c">
// <input type="text" name="export" readonly="readonly" class="no_border w20" value="Test Export">
// </td> <------export Fail...

//////////////////////////////////////////////////////////

dataTables.buttons.js

Line number 1559

if ( config.stripHtml ) {
str = str.replace( /^\s+|\s+$/g, '');
}

Make it empty here.....

If not, is there another way?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,850Questions: 1Answers: 10,519 Site admin
    Answer ✓

    That is correct. By default only the text contents are exported, and the input's value doesn't count as text (its a property).

    You would have to use a custom export function which provides the cell node so you can get the value from it and then return that from the function.

    Allan

  • BWHBWH Posts: 8Questions: 3Answers: 0

    Hello Allan !!

    Thanks for the answer!!

    I solved it the way you told me.

    Thanks!! ^____^

This discussion has been closed.