Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82018

i used the destroy function to reload the table and data but the table is not loading please help

$
0
0
function get_all()
        {
            $('#tbl-category').dataTable().fnDestroy();
            $.ajax({
                url : "../php/all_category.php",
                type : "GET",
                dataType : "JSON",

                success:function (data) {

                    $('#tbl-category').dataTable({
                        "aaData": data,
                        "scrollX": true,
                        "aoColumns": [
                            {"sTitle": "Category", "mData": "catname"},
                            {
                                "sTitle": "Status", "mData": "status", "render": function (mData, type, row, meta) {
                                    if (mData == 1) {
                                        return '<span class="label label-info">Active</span>';
                                    }
                                    else if (mData == 2) {
                                        return '<span class="label label-warning">Deactive</span>';
                                    }
                                }
                            },

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.


Viewing all articles
Browse latest Browse all 82018

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>