Issue dealing with special characters when using export options
Issue dealing with special characters when using export options
![manpat](https://secure.gravatar.com/avatar/b41ef9e5c536146df5e94ace9ab205f0/?default=https%3A%2F%2Fvanillicon.com%2Fb41ef9e5c536146df5e94ace9ab205f0_200.png&rating=g&size=120)
following is the case where an _excel download _won't work until all special characters like / $, apostrophe etc are removed.
http://live.datatables.net/liwupoba/1/edit
Debugger code (debug.datatables.net):
body: function (data, row, column, node) {
if ($(data).is("input"))
return $(data).val();
else if ($(data).is("select"))
return $(data).val();
else
return data;
}
Error messages shown:
spining wheel on the excel button forever until we refresh the page
Description of problem:
An export works just fine but if the data contains a special character I am not able to run my jquery commands to check if the cell has a input or select etc
There was a related discussion, waiting for resolution: https://datatables.net/forums/discussion/49448/export-options-does-not-support-the-special-characters
Replies
Not just this, you got this as well if you look at the console:
That's correct.
Its the original query that DataTable isn't handling special characters, in this case $ is the culprit. It can be anything like / ' $ | etc and the exception halts the export process.
Question is -> Do I need to write overriding logic in export options or there is an elegant solution I am not aware of?
You are trying to use jQuery is() with the data of the column:
You might be better off using the
node
parameter, for example:($(node).is("input")
.If you still need help then please update the example to show more of your specific solution with the input elements.
Kevin