Datatable print view in same Tab

Datatable print view in same Tab

amruthamruth Posts: 6Questions: 3Answers: 0

Hi friends i have a small doubt,
I have a print button in my datatable, when i click on it it will open in new tab of the browser,, how make it open in the same tab when i click on print.

here is mycode for print,

buttons: [
{
extend: 'print',
Layout: 'landscape',
text: "<img style='width:15px;height:15px' src='/Content/Images/Print.png'>",
titleAttr: 'print',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
},
customize: function (win) {
$(win.document.body)
.css('font-size', '10pt')
//.prepend(
// '<img src="http://datatables.net/media/images/logo-fade.png" style="position:absolute; top:0; left:0;" />'
//);

                        $(win.document.body).find('table')
                            .addClass('bottomBorder')
                            .css('font-size', 'inherit');
                    }

                },

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,775Questions: 1Answers: 10,112 Site admin
    Answer ✓

    There isn't an option for that. The print view is an entirely new HTML document, which is why it is opened in a new tab / window. You could modify the code if you wanted to replace the original document, but as I say, that isn't a built in option at this time.

    Allan

  • amruthamruth Posts: 6Questions: 3Answers: 0

    thanks for the information allan.

This discussion has been closed.