Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
This link explains how excatly my screen should be : https://datatables.net/extras/tabletools/[^]

I tried to get my screen like that with PDF ,EXCEL etc buttons but i am unable to do so .

My code :
PHP
$(document).ready(function () {

    var dt = $('#myDataTable').dataTable({

 sDom": 'T<"clear">lfrtip',
                    "oTableTools": {
                        "sSwfPath": "/release-datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
                    }
 // The above code i just used and used tabletools plugin .. My buttons are placed improperly that too very small and on left side out of them only save button is working :) 

       "bProcessing": true,
            "bServerSide": true,
            "sAjaxSource": "Home/AjaxHandler",
            "bJQueryUI": true,
            "aoColumns": [
                                    {
                                        "sName": "Lead_Id",
                                        "bVisible": false,
                                        "bSearchable": false,
                                        "bSortable": false
                                    },
                       {
                           "sName": "Contact_Name"
                           ,
                           "bSearchable": false,
                           "bSortable": false,
                           "fnRender": function (oObj) {
                               return '<a href=\"Home/Details/' + oObj.aData[0] + '\">' + oObj.aData[1] + '</a>';
                           }
                       },
                       { "sName": "Contact_Address" },
                       { "sName": "Lead_Source" },
                       { "sName": "Domain" }
            ]

        });
)};
</pre>



Regards and thank you for lokking into
Posted
Updated 15-Apr-14 21:22pm
v4
Comments
Guruprasad.K.Basavaraju 16-Apr-14 20:54pm    
What version of tabletools have you imported ?
sunil gutta 17-Apr-14 8:54am    
2.1.4 one .. actually am getting buttons on left side i was unable to click on that also .. only when i click on save its working remaining urgh .! no response :( . i used the same datatable version used in creating the perfect output in this link https://datatables.net/extras/tabletools/ .. Regards :) i checked pagesource and done my work but its not working fine for me .
Guruprasad.K.Basavaraju 17-Apr-14 13:43pm    
Sunil, Please click reply on my message :) else I would not know you asnwered my query.

Can you run this in chrome and click inspect element and see if the swf files are loaded ?
sunil gutta 17-Apr-14 15:17pm    
Seriously i am a very bad script debugger that i can count as a big setback where i cant solve my issues properly . How to know swf files are loaded or not .
sunil gutta 17-Apr-14 17:06pm    
Uff finally done but with minor issue present . Now everything working fine but when i save to excel or pdf etc it is only saving displayed records not all records in tables .Only 10 in the sense if i have 31 records there is pagination applied so 31 records are displayed as 10 10 10 1 manner .. for me first 10 only saving to excel , pdf , copy . Any idea why

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900