Uncaught TypeError: Cannot read property ‘oSort’ of undefined

Uncaught TypeError: Cannot read property ‘oSort’ of undefined

vijaykumarvemulavijaykumarvemula Posts: 7Questions: 4Answers: 0

<apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
<apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
<apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />

j$ = jQuery.noConflict(); j$.extend( j$.fn.dataTableExt.oSort, { "point-numeric-pre": function ( a ) { var vals = a.match(/([0-9]+[\.]+[0-9]+([\.]+[0-9]+)?)/g); var res = [0, 0, 0]; if (vals) { vals = vals[0].split('.'); for (var i = 0; i < vals.length; i++) { res[i] = parseInt(vals[i]); } } return 1000000*res[0] + 1000*res[1] + res[2]; }, "point-numeric-asc": function ( a, b ) { return ((a < b) ? -1 : ((a > b) ? 1 : 0)); }, "point-numeric-desc": function ( a, b ) { return ((a < b) ? 1 : ((a > b) ? -1 : 0)); } }); j$(document).ready( function () { var aa = j$('[id$="resultTable"]').DataTable({ columnDefs: [ { type: 'point-numeric', targets: 3 } ], order: [[ 3, "asc" ]] }); });

<c:CustomComponent/>
While opening my page i am getting "Uncaught TypeError: Cannot read property ‘oSort’ of undefined" in the console and pagination of datatables not working. In my custom component have "jquery-1.11.3.min.js". I think it's overriding datatables. How can we overcome..?

Answers

  • allanallan Posts: 64,370Questions: 1Answers: 10,627 Site admin

    Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.

    Information on how to create a test page, if you can't provide a link to your own page can be found here.

    Thanks,
    Allan

This discussion has been closed.