Tabletools print option not working

Tabletools print option not working

rakpoddarrakpoddar Posts: 2Questions: 0Answers: 0
edited June 2011 in TableTools
I ma getting following error with my below code using tabletool &
Error: oSetDT.oScroll is undefined
Source File: http://www.datatables.net/release-datatables/extras/TableTools/media/js/TableTools.js
Line: 1650

var closePrintView = function(e) {
if(e.which == 27) {
printViewClosed();
}
};

function printViewClosed() {
datatable.fnSetColumnVis(7, true);
datatable.fnSetColumnVis(10, true);
datatable.fnSetColumnVis(11, true);
$(window).unbind('keyup', closePrintView);
}
function initRequestDataTable(obj,filters){
var oTable = $(obj).dataTable({
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "http://www.datatables.net/release-datatables/extras/TableTools/media/swf/copy_cvs_xls_pdf.swf",
"aButtons": [
"copy",
{"sExtends": "print",
"bShowAll": false,
"mColumns": [ 0,8,9,1,2,3,6,4,5],
"sMessage": 'Click print or cancel Print',
"fnClick": function (nButton, oConfig, oFlash) {
datatable.fnSetColumnVis(7, false);
datatable.fnSetColumnVis(10, false);
datatable.fnSetColumnVis(11, false);
$('div.dataTables_scrollHead').show();
$(window).keyup(closePrintView);
}
},
{
"sExtends": "collection",
"sButtonText": "Save",
"aButtons": [ "csv", "xls", { "sExtends": "pdf", "sPdfOrientation": "landscape","mColumns": [ 0,8,9,1,2,3,6,4,5]}]
}
]
},
"bProcessing": true,
"bFilter": false,
"bInfo": false,
"bServerSide": true,
"bPaginate": true,
"bJQueryUI": false,
"bSortClasses" : false,
"iDisplayLength": 25,
"bStateSave": true,
"sScrollX": "100%",
"sScrollY": "400px",
"aaSorting": [[0,'desc']],
"bAutoWidth": false,
"bScrollCollapse": true,
"sScrollXInner": "2100px",
"aoColumns": [
{ "sTitle": "ID" , "bSortable" : true,"sWidth" : "90px" },
{ "sTitle": "REQUEST TYPE" , "bSortable" : true,"sWidth" : "340px" },
{ "sTitle": "DATABASE" , "bSortable" : true,"sWidth" : "130px" },
{ "sTitle": "STATUS" , "bSortable" : true,"sWidth" : "200px" },
{ "sTitle": "LAST UPDATED BY" , "bSortable" : true,"sWidth" : "170px" },
{ "sTitle": "LAST UPDATED DATE" , "bSortable" : true,"sWidth" : "170px" },
{ "sTitle": "APPROVER" , "bSortable" : true,"sWidth" : "130px" },
{ "sTitle": "APPROVAL DATE" , "bSortable" : true,"sWidth" : "170px" },
{ "sTitle": "SCHEMA" , "bSortable" : true,"sWidth" : "100px" },
{ "sTitle": "OBJECT NAME" , "bSortable" : true,"sWidth" : "300px" },
{ "sTitle": "REQUESTER" , "bSortable" : true,"sWidth" : "130px" },
{ "sTitle": "CREATION DATE" , "bSortable" : true,"sWidth" : "170px" }],
"sPaginationType": "full_numbers",
"oLanguage": {"sEmptyTable": "No request found","sLengthMenu": 'Display 2550100ALL records'},
"sAjaxSource": "/virt_dashboard?action=management&type=search&response=json" + filters
});

}

Replies

  • rakpoddarrakpoddar Posts: 2Questions: 0Answers: 0
    I am getting following error with my below code using tabletool
    Error: oSetDT.oScroll is undefined
    Source File: http://www.datatables.net/release-datatables/extras/TableTools/media/js/TableTools.js
    Line: 1650
    [code]
    var closePrintView = function(e) {
    if(e.which == 27) {
    printViewClosed();
    }
    };

    function printViewClosed() {
    datatable.fnSetColumnVis(7, true);
    datatable.fnSetColumnVis(10, true);
    datatable.fnSetColumnVis(11, true);
    $(window).unbind('keyup', closePrintView);
    }
    function initRequestDataTable(obj,filters){
    var oTable = $(obj).dataTable({
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
    "sSwfPath": "http://www.datatables.net/release-datatables/extras/TableTools/media/swf/copy_cvs_xls_pdf.swf",
    "aButtons": [
    "copy",
    {"sExtends": "print",
    "bShowAll": false,
    "mColumns": [ 0,8,9,1,2,3,6,4,5],
    "sMessage": 'Click print or cancel Print',
    "fnClick": function (nButton, oConfig, oFlash) {
    datatable.fnSetColumnVis(7, false);
    datatable.fnSetColumnVis(10, false);
    datatable.fnSetColumnVis(11, false);
    $('div.dataTables_scrollHead').show();
    $(window).keyup(closePrintView);
    }
    },
    {
    "sExtends": "collection",
    "sButtonText": "Save",
    "aButtons": [ "csv", "xls", { "sExtends": "pdf", "sPdfOrientation": "landscape","mColumns": [ 0,8,9,1,2,3,6,4,5]}]
    }
    ]
    },
    "bProcessing": true,
    "bFilter": false,
    "bInfo": false,
    "bServerSide": true,
    "bPaginate": true,
    "bJQueryUI": false,
    "bSortClasses" : false,
    "iDisplayLength": 25,
    "bStateSave": true,
    "sScrollX": "100%",
    "sScrollY": "400px",
    "aaSorting": [[0,'desc']],
    "bAutoWidth": false,
    "bScrollCollapse": true,
    "sScrollXInner": "2100px",
    "aoColumns": [
    { "sTitle": "ID" , "bSortable" : true,"sWidth" : "90px" },
    { "sTitle": "REQUEST TYPE" , "bSortable" : true,"sWidth" : "340px" },
    { "sTitle": "DATABASE" , "bSortable" : true,"sWidth" : "130px" },
    { "sTitle": "STATUS" , "bSortable" : true,"sWidth" : "200px" },
    { "sTitle": "LAST UPDATED BY" , "bSortable" : true,"sWidth" : "170px" },
    { "sTitle": "LAST UPDATED DATE" , "bSortable" : true,"sWidth" : "170px" },
    { "sTitle": "APPROVER" , "bSortable" : true,"sWidth" : "130px" },
    { "sTitle": "APPROVAL DATE" , "bSortable" : true,"sWidth" : "170px" },
    { "sTitle": "SCHEMA" , "bSortable" : true,"sWidth" : "100px" },
    { "sTitle": "OBJECT NAME" , "bSortable" : true,"sWidth" : "300px" },
    { "sTitle": "REQUESTER" , "bSortable" : true,"sWidth" : "130px" },
    { "sTitle": "CREATION DATE" , "bSortable" : true,"sWidth" : "170px" }],
    "sPaginationType": "full_numbers",
    "oLanguage": {"sEmptyTable": "No request found","sLengthMenu": 'Display 2550100ALL records'},
    "sAjaxSource": "/virt_dashboard?action=management&type=search&response=json" + filters
    });

    }
    [/code]
This discussion has been closed.