Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header title created with headerCallback are not exported #74

Open
xibman opened this issue Jan 28, 2015 · 0 comments
Open

Header title created with headerCallback are not exported #74

xibman opened this issue Jan 28, 2015 · 0 comments

Comments

@xibman
Copy link

xibman commented Jan 28, 2015

If you use the header callback to insert column title, it isn't use on csv,excel and pdf export.

just change this line in _fnGetDataTablesData:

sLoopData = dt.aoColumns[i].sTitle.replace(/\n/g," ").replace( /<.*?>/g, "" ).replace(/^\s+|\s+$/g,"");
sLoopData = this._fnHtmlDecode( sLoopData );

by

sLoopData = dt.aoColumns[i].sTitle !='' ? dt.aoColumns[i].sTitle : dt.aoColumns[i].nTh.innerText;
sLoopData = sLoopData.replace(/\n/g," ").replace( /<.*?>/g, "" ).replace(/^\s+|\s+$/g,"");
sLoopData = this._fnHtmlDecode( sLoopData );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant