Returned data sort array (col 4) is the wrong length in jquery datatable

Returned data sort array (col 4) is the wrong length in jquery datatable

emgenitorsemgenitors Posts: 3Questions: 1Answers: 0

I have column which contains some empty entries .When I click on that column to sort ,it throws following exception

"Returned data sort array (col 4) is the wrong length in jquery datatable" on console

Can u please let me know How to resolve this issue??

Answers

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    Can you link to the page with the error? Or create it in JSBin so we can replicate it? Or even the JS code for your DT instance?

    You need to give us something to use for debugging/troubleshooting, other than just the problem..

    I have plenty of empty columns, and it sorts just fine, so im assuming this is something specific to your DT instance

  • emgenitorsemgenitors Posts: 3Questions: 1Answers: 0

    Hi

    Here is the code

    $('#INV_ACC_DETAIL_tbl').show();
    var tblCols= {"columns":[{"sTitle":"Item","mData":"col0","sType":"","width":"11%","aSortDataType":"","sClass":"left","showTotalFooter":false},{"sTitle":"Shelf Order","mData":"col1","sType":"numeric","width":"11%","sClass":"text-right","showTotalFooter":false},{"sTitle":"Quantity","mData":"col2","sType":"numeric-comma","width":"11%","aSortDataType":"dom-text","sClass":"text-right","showTotalFooter":true,"total":"35.0"},{"sTitle":"Inventory UOM","mData":"col3","sType":"","width":"11%","aSortDataType":"","sClass":"left","showTotalFooter":false},{"sTitle":"Quantity","mData":"col4","sType":"numeric-comma","width":"11%","aSortDataType":"dom-text","sClass":"text-right","showTotalFooter":true,"total":"2109.25"},{"sTitle":"Inventory UOM","mData":"col5","sType":"","width":"11%","aSortDataType":"","sClass":"left","showTotalFooter":false},{"sTitle":"Quantity","mData":"col6","sType":"numeric-comma","width":"11%","aSortDataType":"dom-text","sClass":"text-right","showTotalFooter":true,"total":"0.0"},{"sTitle":"Inventory UOM","mData":"col7","sType":"","width":"11%","aSortDataType":"","sClass":"left","showTotalFooter":false},{"sTitle":"Total Cost","mData":"col8","sType":"currency","width":"11%","sClass":"text-right","showTotalFooter":true,"dataType":"DOLLAR","total":"1969.524683333333"}],"rows":[],"isReadOnly":false};
    var aoColumns=getDataTableCols(tblCols.columns);
    var oTable = $('#INV_ACC_DETAIL_tbl').dataTable({
    "bProcessing": false,
    "bPaginate": 1,
    "aoColumns": aoColumns,
    "bSort":true,
    "bJQueryUI": true,
    "bLengthChange": 1,
    "sDom": "Rl<'activeTypeIID'>frtip",
    "sScrollX": "100%",
    "aaSorting": [],
    "bScrollCollapse": true,
    "sScrollY": "350px",

                    "aLengthMenu": [[10, 25, 50,100], [10, 25, 50,100]],
                    "iDisplayLength": [[10, 25, 50,100], [10, 25, 50,100]][0][0] ,
    
                    "oLanguage": {
                        "sZeroRecords": "No Information present for this Selection.",
                        "sInfoEmpty": "Showing 0 - 0 of 0 records",
                        "sInfo": "Showing _START_ - _END_ of _TOTAL_ records",
                        "sLengthMenu": "_MENU_ Records per page"
                    },
                    "fnDrawCallback": function() { 
                        var divObj = $('#INV_ACC_DETAIL_tbl').parents();
                        divObj
                        .find('.dataTables_scrollBody')
                        .createNiceScroll();
                        divObj.find('.dataTables_scrollBody').getNiceScroll().show().onResize();
                        $('.dataTables_scrollBody select').selectBox();
                        $(".testclass").datepicker({autoclose:true});   
                        divObj.find('.dataTables_scrollBody').addClass('resizeGrid');                       
                    },
    
  • emgenitorsemgenitors Posts: 3Questions: 1Answers: 0

    $('#INV_ACC_DETAIL_tbl').show();

    var tblCols= {"columns":[{"sTitle":"Item","mData":"col0","sType":"","width":"11%","aSortDataType":"","sClass":"left","showTotalFooter":false},{"sTitle":"Shelf Order","mData":"col1","sType":"numeric","width":"11%","sClass":"text-right","showTotalFooter":false},{"sTitle":"Quantity","mData":"col2","sType":"numeric-comma","width":"11%","aSortDataType":"dom-text","sClass":"text-right","showTotalFooter":true,"total":"35.0"},{"sTitle":"Inventory UOM","mData":"col3","sType":"","width":"11%","aSortDataType":"","sClass":"left","showTotalFooter":false},{"sTitle":"Quantity","mData":"col4","sType":"numeric-comma","width":"11%","aSortDataType":"dom-text","sClass":"text-right","showTotalFooter":true,"total":"2109.25"},{"sTitle":"Inventory UOM","mData":"col5","sType":"","width":"11%","aSortDataType":"","sClass":"left","showTotalFooter":false},{"sTitle":"Quantity","mData":"col6","sType":"numeric-comma","width":"11%","aSortDataType":"dom-text","sClass":"text-right","showTotalFooter":true,"total":"0.0"},{"sTitle":"Inventory UOM","mData":"col7","sType":"","width":"11%","aSortDataType":"","sClass":"left","showTotalFooter":false},{"sTitle":"Total Cost","mData":"col8","sType":"currency","width":"11%","sClass":"text-right","showTotalFooter":true,"dataType":"DOLLAR","total":"1969.524683333333"}],"rows":[],"isReadOnly":false};

    var aoColumns=getDataTableCols(tblCols.columns);

    var oTable = $('#INV_ACC_DETAIL_tbl').dataTable({
    "bProcessing": false,
    "bPaginate": 1,
    "aoColumns": aoColumns,
    "bSort":true,
    "bJQueryUI": true,
    "bLengthChange": 1,
    "sDom": "Rl<'activeTypeIID'>frtip",
    "sScrollX": "100%",
    "aaSorting": [],
    "bScrollCollapse": true,
    "sScrollY": "350px",

                    "aLengthMenu": [[10, 25, 50,100], [10, 25, 50,100]],
                    "iDisplayLength": [[10, 25, 50,100], [10, 25, 50,100]][0][0] ,
    
                    "oLanguage": {
                        "sZeroRecords": "No Information present for this Selection.",
                        "sInfoEmpty": "Showing 0 - 0 of 0 records",
                        "sInfo": "Showing _START_ - _END_ of _TOTAL_ records",
                        "sLengthMenu": "_MENU_ Records per page"
                    },
                    "fnDrawCallback": function() { 
                        var divObj = $('#INV_ACC_DETAIL_tbl').parents();
                        divObj
                        .find('.dataTables_scrollBody')
                        .createNiceScroll();
                        divObj.find('.dataTables_scrollBody').getNiceScroll().show().onResize();
                        $('.dataTables_scrollBody select').selectBox();
                        $(".testclass").datepicker({autoclose:true});   
                        divObj.find('.dataTables_scrollBody').addClass('resizeGrid');                       
                    },
    
This discussion has been closed.