COPY EXCEL PDF buttons appear at bottom

COPY EXCEL PDF buttons appear at bottom

wasimwaniwasimwani Posts: 19Questions: 5Answers: 0

When i click the "Save" button COPY EXCEL PDF buttons appear at bottom of screen though all the options work as expected but why are they appearing at bottom of table when they should have been appearing below "Save" button.Here is the screen shot for same . http://postimg.org/image/6hz11zytx/ Here is the code

"tableTools": {
        "sRowSelect": "os",
        "sSwfPath": "../../../TableTools/swf/copy_csv_xls_pdf.swf",
        "aButtons": [
            { "sExtends": "editor_create", "editor": editor },
            { "sExtends": "editor_edit",   "editor": editor },
            { "sExtends": "editor_remove", "editor": editor },
            {
                sExtends: "collection",
                sButtonText: "Save",
                sButtonClass: "save-collection",
                aButtons: [ 'copy', 'xls', 'pdf' ]
            },
            'print'
        ]
    }

Answers

  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394

    Use the "dom" param to determine placing of TableTools buttons.

    http://datatables.net/extensions/tabletools/

  • wasimwaniwasimwani Posts: 19Questions: 5Answers: 0

    @tangerine I changed the code but still problem persists

    "tableTools": {
            "sRowSelect": "os",
            "dom": 'T<"clear">lfrtip',
            "sSwfPath": "../../../TableTools/swf/copy_csv_xls_pdf.swf",
            "aButtons": [
                { "sExtends": "editor_create", "editor": editor },
                { "sExtends": "editor_edit",   "editor": editor },
                { "sExtends": "editor_remove", "editor": editor },
                {
                    sExtends: "collection",
                    sButtonText: "Save",
                    sButtonClass: "save-collection",
                    aButtons: [ 'copy', 'xls', 'pdf' ]
                },
                'print'
            ]
        }
    
  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394

    Look at the example again. You need to set up "dom" before you initialise TableTools.

  • wasimwaniwasimwani Posts: 19Questions: 5Answers: 0

    @tangerine Tried the way as shown in example but still same problem

                 "dom": 'Tfrtip', 
        "tableTools": {
            //"sRowSelect": "os",
            //"dom": 'T<"clear">lfrtip',
            //"sSwfPath": "../../../TableTools/swf/copy_csv_xls_pdf.swf",
             "sSwfPath": "/swf/copy_csv_xls_pdf.swf",
            "aButtons": [
                { "sExtends": "editor_create", "editor": editor },
                { "sExtends": "editor_edit",   "editor": editor },
                { "sExtends": "editor_remove", "editor": editor },
                {
                    sExtends: "collection",
                    sButtonText: "Save",
                    sButtonClass: "save-collection",
                    aButtons: [ 'copy', 'xls', 'pdf' ]
                },
                'print'
            ]
        }
    
  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394

    Where is

    $(document).ready( function () {
        $('#example').dataTable( {
    

    ?

  • wasimwaniwasimwani Posts: 19Questions: 5Answers: 0

    Here is my complete code...I had pasted just a snippet earlier

    $('#JKBINSR').dataTable( {
        "dom": "Tfrtip",
        "ajax": "php/table.JKBINSR.php",
        "columns": [
            {
                "data": "accntno"
            },
            {
                "data": "accnttitle"
            },
            {
                "data": "alias"
            },
            {
                "data": "doi"
            },
            {
                "data": "doe"
            },
            {
                "data": "amount"
            },
            {
                "data": "POLNO"
            },
            {
                "data": "remark"
            }
        ],
    
    
        "tableTools": {
            //"sRowSelect": "os",
            //"dom": 'T<"clear">lfrtip',
            //"sSwfPath": "../../../TableTools/swf/copy_csv_xls_pdf.swf",
             "sSwfPath": "/swf/copy_csv_xls_pdf.swf",
            "aButtons": [
                { "sExtends": "editor_create", "editor": editor },
                { "sExtends": "editor_edit",   "editor": editor },
                { "sExtends": "editor_remove", "editor": editor },
                {
                    sExtends: "collection",
                    sButtonText: "Save",
                    sButtonClass: "save-collection",
                    aButtons: [ 'copy', 'xls', 'pdf' ]
                },
                'print'
            ]
        }
    } );
    
  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394

    Oh, I see. Well, in that case I don't know what the problem is. Your dom definition looks ok. Might it be a CSS problem?

  • allanallan Posts: 61,758Questions: 1Answers: 10,111 Site admin

    I'm not sure what the issue is either. We would need a link to the page so it could be debugged. Certainly looks like a CSS issue.

    Allan

This discussion has been closed.