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

[Need help] Cannot call method 'fnInit' of undefined

$
0
0
I have a code like that

 $.ajax({
                type : 'POST',
                url : 'classfication_of_productjson.html',
                dataType : 'json',
                data : {
                    "limited_num" : limited_num,
                    "search_bunrui_code" : code,
                    "orderType" : orderType,
                    "search_base_date_from" : search_base_date_from,
                    "search_base_date_to" : search_base_date_to,
                    "compare_date_from" : compare_date_from,
                    "compare_date_to" : compare_date_to,
                    "compare_menu" : compare_menu,
                    "shopCode0000" : shopCode0000,
                    "shopCode0001" : shopCode0001,
                    "shopCode0002" : shopCode0002,
                    "shopCode0009" : shopCode0009,
                    "shopCode0003" : shopCode0003,
                    "shopCode0006" : shopCode0006,
                    "shopCode9000" : shopCode9000,
                    "shopCode9001" : shopCode9001
                },

                success : function(data) {
                    console.log(data);
                    $('#dataTable').dataTable({
                        "bServerSide": true,
                        "sAjaxSource": data,
                        "sAjaxDataProp": data,
                        "bProcessing": true,
                        "sPaginationType": "full_numers",
                        "bJQueryUI": true
                    });
                    //$('#loadData').html(data);
                    var elapsed = (new Date().getTime() - start) / 1000;
                    $("#search_time").html("検索時間<br>" + elapsed + "(s)");
                    visibleColumn();
                },
                 beforeSend : call_request,
                complete : complete_request,
            });

When i click on a link it call ajax and draw datatable. i can get the json data from the server. but it has an error " Cannot call method 'fnInit' of undefined"
_fnFeatureHtmlPaginate jquery.dataTables.nightly.js:2872
_fnAddOptionsHtml jquery.dataTables.nightly.js:1729
_fnInitialise jquery.dataTables.nightly.js:2593
(anonymous function) jquery.dataTables.nightly.js:6793
jQuery.extend.each jquery-1.8.3.js:611
jQuery.fn.jQuery.each jquery-1.8.3.js:241
DataTable jquery.dataTables.nightly.js:6366
$.ajax.success classfication_of_product.html:1039
fire jquery-1.8.3.js:974
self.fireWith jquery-1.8.3.js:1084
done jquery-1.8.3.js:7803
callback

I am using Struts2

Thanks for any help

Viewing all articles
Browse latest Browse all 82115

Trending Articles



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