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

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>';
                                }
                            }
                        },

Viewing all articles
Browse latest Browse all 81999

Trending Articles



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