Using JSTL and Spring to Populate a DataTable then Export
Using JSTL and Spring to Populate a DataTable then Export
Tykin
Posts: 1Questions: 0Answers: 0
Hi there,
I am trying to use DataTables and TableTools to export a table I created using Spring Framework. The table works great, as does TableTools, with the exception of one pestering bug. When I am traversing an Array from Spring, the Copied and Exported values show up multiple columns later. Here is my code:
[code]
$(document).ready( function () {
var table = $('#example').DataTable({
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "swf/copy_csv_xls_pdf.swf",
"mColumns": "visible"
}
})
.on('mousedown', '.hasTooltip', function(event) {
$(this).qtip({
hide: {
event: 'unfocus',
inactive: 2000,
effect: function() {
$(this).slideUp();
}
},
style: {
classes: 'qtip-bootstrap qtip-shadow'
},
overwrite: false,
content: {
text: $(this).next('div') // Use the "div" element next to this for the content
},
show: {
event: event.type,
ready: true
}
});
});
} );
Nickname
Location
Site
Type
Total
Jobs with Failures
${row.nickname}
${row.site}
${row.location}
${row.site}
${row.type}
${row.failures}
${failrow}
[/code]
My problem is, when I go to export, the ${failrow} entries are multiple columns apart rather than being in the same cell. Strangely, this issue only occurs with FireFox and Chrome, but has no issue with IE. Unfortunately, I cannot post an example as the server is hosted internally.
I am trying to use DataTables and TableTools to export a table I created using Spring Framework. The table works great, as does TableTools, with the exception of one pestering bug. When I am traversing an Array from Spring, the Copied and Exported values show up multiple columns later. Here is my code:
[code]
$(document).ready( function () {
var table = $('#example').DataTable({
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "swf/copy_csv_xls_pdf.swf",
"mColumns": "visible"
}
})
.on('mousedown', '.hasTooltip', function(event) {
$(this).qtip({
hide: {
event: 'unfocus',
inactive: 2000,
effect: function() {
$(this).slideUp();
}
},
style: {
classes: 'qtip-bootstrap qtip-shadow'
},
overwrite: false,
content: {
text: $(this).next('div') // Use the "div" element next to this for the content
},
show: {
event: event.type,
ready: true
}
});
});
} );
Nickname
Location
Site
Type
Total
Jobs with Failures
${row.nickname}
${row.site}
${row.location}
${row.site}
${row.type}
${row.failures}
${failrow}
[/code]
My problem is, when I go to export, the ${failrow} entries are multiple columns apart rather than being in the same cell. Strangely, this issue only occurs with FireFox and Chrome, but has no issue with IE. Unfortunately, I cannot post an example as the server is hosted internally.
This discussion has been closed.
Replies