smart admin Datatable features

smart admin Datatable features

rahulvyasrahulvyas Posts: 2Questions: 1Answers: 0
edited November 2014 in Free community support

Hello sir,

Currently i am working on smart admin Export to pdf and excel Datatable but i am not able to see features like paging and pdf,excel,copy and search feature when i am checking problem i am finding that there is problem in loadScript function .

Answers

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

    Please link to a test case showing the issue, as required in the forum rules.

    Allan

  • rahulvyasrahulvyas Posts: 2Questions: 1Answers: 0
    edited November 2014

    Hi Allan,

    Thanks For reply, I am using this script for Pagin and Search text box and Export button in Datatable but i got error in Load script function ("ReferenceError: loadScript is not defined")
    in last row of my code. following code attach here

    $('#datatable_tabletools').dataTable({
    
                    // Tabletools options: 
                    //   https://datatables.net/extensions/tabletools/button_options
                    "sDom": "<'dt-toolbar'<'col-xs-12 col-sm-6'f><'col-sm-6 col-xs-6 hidden-xs'T>r>" +
                            "t" +
                            "<'dt-toolbar-footer'<'col-sm-6 col-xs-12 hidden-xs'i><'col-sm-6 col-xs-12'p>>",
                    "oTableTools": {
                        "aButtons": [
                        "copy",
                        "csv",
                        "xls",
                           {
                               "sExtends": "pdf",
                               "sTitle": "SmartAdmin_PDF",
                               "sPdfMessage": "SmartAdmin PDF Export",
                               "sPdfSize": "letter"
                           },
                           {
                               "sExtends": "print",
                               "sMessage": "Generated by SmartAdmin <i>(press Esc to close)</i>"
                           }
                        ],
                        "sSwfPath": "js/plugin/datatables/swf/copy_csv_xls_pdf.swf"
                    },
                    "autoWidth": true,
                    "preDrawCallback": function () {
                        // Initialize the responsive datatables helper once.
                        if (!responsiveHelper_datatable_tabletools) {
                            responsiveHelper_datatable_tabletools = new ResponsiveDatatablesHelper($('#datatable_tabletools'), breakpointDefinition);
                        }
                    },
                    "rowCallback": function (nRow) {
                        responsiveHelper_datatable_tabletools.createExpandIcon(nRow);
                    },
                    "drawCallback": function (oSettings) {
                        responsiveHelper_datatable_tabletools.respond();
                    }
                });
    
                /* END TABLETOOLS */
    
            };
    
            // load related plugins
            
    
    
            loadScript("js/smartadmin/js/plugin/datatables/jquery.dataTables.min.js", function () {
                loadScript("js/smartadmin/js/plugin/datatables/dataTables.colVis.min.js", function () {
                    loadScript("js/smartadmin/js/plugin/datatables/dataTables.tableTools.min.js", function () {
                        loadScript("js/smartadmin/js/plugin/datatables/dataTables.bootstrap.min.js", function () {
                            loadScript("js/smartadmin/js/plugin/datatable-responsive/datatables.responsive.min.js", pagefunction)
                        });
                    });
                });
            });
    
  • allanallan Posts: 61,757Questions: 1Answers: 10,111 Site admin

    ReferenceError: loadScript is not defined

    That's not a DataTables error message, and DataTables doesn't define the loadScript function. You would need to look into whatever it meant to provide that function.

    Allan

This discussion has been closed.