Excel export input value
Excel export input value
Hello!, I am having problems exporting data from an input field. I am putting together a table with a quantity column in which the user must be able to write the quantity and then export it to excel along with other data in the row.
I followed the examples from user Tronik's question
I also followed the examples in the guide "Format output data - export options" but I couldn't achieve it.
I think the error is somewhere in this part of the code:
` var ExportFormat = {
format: {
body: function (data, row, column, node) {
//check if type is input using jquery
return $(node).is("input") ?
$(node).find('input').val():
data;
}
}
};
`
I leave you a test case: https://live.datatables.net/buvekobe/1/edit
What am I doing wrong?
This question has an accepted answers - jump to answer
Answers
Using
$('input', node).length
to check for aninput
tag seems to work better:https://live.datatables.net/lupupahu/1/edit
$(node).is("input")
seems to always befalse
.Kevin
Thank you so much!