TableExport icon indicating copy to clipboard operation
TableExport copied to clipboard

Exporting data from inputs

Open grizzm0 opened this issue 6 years ago • 5 comments

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 avatar Jan 23 '18 09:01 grizzm0

@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.

clarketm avatar Feb 14 '18 20:02 clarketm

It would be great if this was doable.

bhansson avatar Apr 03 '18 14:04 bhansson

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);

bhansson avatar Jul 20 '18 09:07 bhansson

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?

lfernandes avatar Dec 10 '19 21:12 lfernandes

Yeah i need to know where to use settings.formatValue(content); property

fuzunspm avatar Jan 20 '20 09:01 fuzunspm