searchPanes DataTable " No data available in table " message found

searchPanes DataTable " No data available in table " message found

nilesh1130nilesh1130 Posts: 8Questions: 0Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Replies

  • nilesh1130nilesh1130 Posts: 8Questions: 0Answers: 0

  • nilesh1130nilesh1130 Posts: 8Questions: 0Answers: 0

    uploaded screenshot say everything about my issue

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @nilesh1130 ,

    I have to disagree with you I'm afraid, we need a lot more than that to be able to help.

    As noted in the forum rules, please post a link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Thanks,
    Sandy

  • nilesh1130nilesh1130 Posts: 8Questions: 0Answers: 0

    var dataTable = $('.table').DataTable({

        pagingType: "full_numbers",
        bPaginate: false,
        order: [[1, 'desc']],
        pageLength: 100,
        processing: true,
        serverSide: true,
        searching: true,
    
        language: {
        "processing": '<img src="<?php echo url('/img/framely.gif'); ?>" id="AJloader"  alt="Team Spirit" width="100%">' //add a loading image,simply putting <img src="loader.gif" /> tag.
         },
        ajax: {
            url: "{!! route('order.list') !!}",
            type: 'POST',
            headers: {
                'X-CSRF-TOKEN': '{{ csrf_token() }}'
            },
            data: function(data) {
                var orderStatus = $('#orderStatus').val();
                var orderSalesRep = $('#orderSalesRep').val();
                var orderCustomer = $('#orderCustomer').val();
                var orderSupplier = $('#orderSupplier').val();
                var orderNumber = $('#orderNumber').val();
                var date_filter = $('#date_filter').val();
                var searchdirecttocust = $('#searchdirecttocust').val();
    
                data.searchByOrderStatus = orderStatus;
                data.searchByOrderSalesRep = orderSalesRep;
                data.searchByOrderCustomer = orderCustomer;
                data.searchByOrderSupplier = orderSupplier;
                data.searchByOrderNumber = orderNumber;
                data.searchByFactoryDispatch = date_filter;
                data.searchByDirectToCust = searchdirecttocust;
            }
        },
    
        columns: [
            { data: "order_date" },
            { data: "order_no" },
            { data: "status" },
            { data: "customer" },
            { data: "factory_dispatch" },
    
        ],searchPanes: {
    
                        },
        columnDefs: [
            { className: 'text-center',searchPanes:{ show: true,columns: [ 0 ] }, targets: [0],
                render: function(data, type, full, meta) {
                    return "<a href='"+window.location.protocol + "//" + window.location.host + "/admin/order/info/" +full['order_no']+"' data-type='{{ Auth::user()->type }}' data-order_no='"+full['order_no']+"'>" + data.split(' ')[0] + "</a>";
                }
            },
            { className: 'text-center',searchPanes:{ show: true,columns: [ 1 ] }, targets: [1],
                render: function(data, type, full, meta) {
                     var url = document.location.origin + "/teamspirit/notification/";
                    $.ajax({ type: "POST", url: url, data: { 'orderno': full['order_no'] , 'type': "Admin" },
                        success: function(data) { if(data != 0) $('#nf'+ full['id']).html("<span class='label notification'>"+data+"</span>"); }
                    });
                    return "<a href='"+window.location.protocol + "//" + window.location.host + "/teamspirit/admin/order/info/" +full['order_no']+"' data-type='{{ Auth::user()->type }}' data-order_no='"+full['order_no']+"'>" + data + "</a><span class='pull-right-container' id='nf"+full['id']+"'></span>";
                }
            },
            { className: 'text-center',searchPanes:{ show: true,columns: [ 2 ] }, targets: [2],
                render: function(data, type, full, meta) {
                    if(data == 'New') {
                    return "<a href='"+window.location.protocol + "//" + window.location.host + "/teamspirit/admin/order/info/" +full['order_no']+"' data-type='{{ Auth::user()->type }}' data-order_no='"+full['order_no']+"'><button type='button' class='btn btn-xs btn-default'>" + data + "</button></a>";
                    } else if(data == 'Order Processed') {
                    return "<a href='"+window.location.protocol + "//" + window.location.host + "/teamspirit/admin/order/info/" +full['order_no']+"' data-type='{{ Auth::user()->type }}' data-order_no='"+full['order_no']+"'><button type='button' class='btn btn-xs btn-primary'>" + data + "</button></a>";
    
                    }
                }
            },
            { className: 'text-center',searchPanes:{ show: false, }, targets: [3],
                render: function(data, type, full, meta) {
                    if(data) {
                        return "<a href='"+window.location.protocol + "//" + window.location.host + "/teamspirit/admin/order/info/" +full['order_no']+"' data-type='{{ Auth::user()->type }}' data-order_no='"+full['order_no']+"'>" + data + "</a>";
                    } else {
                        return "";
                    }
                }
            },
            { className: 'text-center',searchPanes:{ show: false, }, targets: [4],
                render: function(data, type, full, meta) {
    
                    if(data) { 
                        if(full['direct'] == 1){ var res = [32]; }else{                 
                           if (/[/s]+/.test(data)) {
                                   var res = data.split("/");
                             }else{
                                var res = data.split("-");
                             }
                        }     
                        return "<a href='"+window.location.protocol + "//" + window.location.host + "/teamspirit/admin/order/info/" +full['order_no']+"' data-type='{{ Auth::user()->type }}' data-order_no='"+full['order_no']+"' class='highlightDataTable"+parseInt(res[0])+"'>" + data + "</a>";
    
                    } else {
                        return "";
                    }
                }
            },
            { className: 'text-center',searchPanes:{ show: false, }, targets: [5],
                render: function(data, type, full, meta) {
                    if(data) {
                        return "<a href='"+window.location.protocol + "//" + window.location.host + "/teamspirit/admin/order/info/" +full['order_no']+"' data-type='{{ Auth::user()->type }}' data-order_no='"+full['order_no']+"'>" + data + "</a>";
                    } else {
                        return "";
                    }
                }
            },
            { className: 'text-center',searchPanes:{ show: false, }, targets: [6],
                render: function(data, type, full, meta) {
                    return "<a href='"+window.location.protocol + "//" + window.location.host + "/teamspirit/admin/order/info/" +full['order_no']+"' data-type='{{ Auth::user()->type }}' data-order_no='"+full['order_no']+"'>" + data + "</a>";
                }
            },
            { className: 'text-center',searchPanes:{ show: false, }, targets: [7],
                render: function(data, type, full, meta) {
                    if(data) {
                        return "<a href='"+window.location.protocol + "//" + window.location.host + "/teamspirit/admin/order/info/" +full['order_no']+"' data-type='{{ Auth::user()->type }}' data-order_no='"+full['order_no']+"'>" + data + "</a>";
                    } else {
                        return "";
                    }
                }
            },
            { className: 'text-center',searchPanes:{ show: false, }, targets: [8],
                render: function(data, type, full, meta) {
                    if(data) {
                        return "<a href='"+window.location.protocol + "//" + window.location.host + "/teamspirit/admin/order/info/" +full['order_no']+"' data-type='{{ Auth::user()->type }}' data-order_no='"+full['order_no']+"'>" + data + "</a>";
                    } else {
                        return "";
                    }
                }
            },
            { className: 'text-center',searchPanes:{ show: false, }, targets: [9],
                render: function(data, type, full, meta) {
                    if(data) {
                        return "<a href='"+window.location.protocol + "//" + window.location.host + "/teamspirit/admin/order/info/" +full['order_no']+"' data-type='{{ Auth::user()->type }}' data-order_no='"+full['order_no']+"'>" + data + "</a>";
                    } else {
                        return "";
                    }
                }
            },
            { className: 'text-center',searchPanes:{ show: false, }, targets: [10],
                render: function(data, type, full, meta) {
    
                var url = document.location.origin + "/teamspirit/order/pdfview/" + full['order_no'];
                var data = "orderno="+ full['order_no'];
                $.ajax({ type: "POST", url: url, data: data,
                    success: function(data) { $('#pv'+ full['id']).attr('href',data); }
                });
    
                       return "<button type='button' data-module='Order' id='"+full['id']+"' data-name='"+full['order_no']+"' class='btn btn-xs btn-primary btn-pdfview'>View invoice</button><a target='_blank' id='pv"+full['id']+"' href='' class='pdfviewer btn-block btn-primary gallery1'></a>";
    
                }
            },
    
            },
        ],
       searchPanes:true,    
    
        select: true,         
        buttons: [
        {
        extend: 'excelHtml5',
        className: "btn btn-primary",
        text: 'Export to Excel',
        title: 'Data export'
        }, 
        {
                extend: 'searchPanes',
                config: {
                    cascadePanes: true
                }
        },
        ],
         dom: 'Bfrtip',  
    });
    

    want to add filter but found " No data available in table " on popup but i found data in table so code is erase by me

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • nilesh1130nilesh1130 Posts: 8Questions: 0Answers: 0

    Thank you so so much for reply but i find solution if anywhere i will stuck i will come here again for support Thanks once again

This discussion has been closed.