Export to csv using Buttons. Filter inner Jquery before exporting

Export to csv using Buttons. Filter inner Jquery before exporting

jhaugheyjhaughey Posts: 1Questions: 1Answers: 0

Hi,

I have a table which includes a jquery link in column one. When we export the data, column one includes Javascript code. I tried to create the action function to remove the code but had no luck.

OUTPUT from export:

App Name Salsa ID App Status Critical Notifications App Level Score Target Stretch Target
"application1 jQuery(document).ready(function () { var options_anchor_599436381 = {}; options_anchor_599436381.jqueryaction = anchor""; options_anchor_599436381.id = ""anchor_599436381""; options_anchor_599436381.targets = ""appSummary""; options_anchor_599436381.href = ""/nfmi/applicationSummaryView.action""; options_anchor_599436381.hrefparameter = ""applicationModel.appListIndex=12""; jQuery.struts2_jquery.bind(jQuery('#anchor_599436381')" options_anchor_599436381); });" APP0 Full Y 28 4 81% 90% 95%

Datatable code:

$("#appsummary").DataTable( {
dom : "<'row'<'col-md-3'l><'col-md-4'f><'col-md-3'><'col-md-2'B>>t<'row'<'col-md-6'i><'col-md-6'p>>",
lengthMenu : [ [ 10, 25, 50, -1 ],
        [ 10, 25, 50, "All" ] ],
buttons : [ {
    extend : 'copyFlash',
    text : 'Copy current page',
    action : function ( sVal, iColumn, nTr, iDataIndex ) {
                if (iColumn === 0) {
                    var str = sVal
                    var end = str.indexOf("jQuery")-1;
                    return sVal.substring(0, end);
                }
            return sVal;
            }} ]});

any help would be much appreciated.

Thanks,

Jim

This discussion has been closed.