TableExport
TableExport copied to clipboard
Exporting data from inputs
We've got a table where some td's contains text while others contain an input. Inputs seems to be ignored by tableexport. Any plans to support this behaviour?
Example:
<td>
<input type="text">
</td>
@grizzm0 – we are merely retrieving the cell's textContent
at the moment. Albeit, it might be worthwhile to provide a format
override that can be attached to the td
element (or globally) to alter this behavior. I can provide that hook (so the user can supply their format function) and prepare it for an upcoming release if this approach is something of value to you and the other users.
It would be great if this was doable.
Here is a working solution we're using at the moment, if there is an input, we use that value, if not we use textContent.
var content = val.getElementsByTagName('INPUT')[0] !== undefined ? val.getElementsByTagName('INPUT')[0].value : val.textContent;
return settings.formatValue(content);
Here is a working solution we're using at the moment, if there is an input, we use that value, if not we use textContent.
var content = val.getElementsByTagName('INPUT')[0] !== undefined ? val.getElementsByTagName('INPUT')[0].value : val.textContent; return settings.formatValue(content);
sorry, where you've inserted it?
Yeah i need to know where to use settings.formatValue(content);
property