(HTML5 export buttons) "Input fields" not export?
(HTML5 export buttons) "Input fields" not export?
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
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
Hello Allan !!
Thanks for the answer!!
I solved it the way you told me.
Thanks!! ^____^