I am trying to complete a task, just like this question .
- I have a working jQuery dataTable
- I need a reset reset function, which, before the user selects any column, is the same as reading from HTML.
This led me to a good plugin.
http://datatables.net/plug-ins/api/fnSortNeutral
jQuery.fn.dataTableExt.oApi.fnSortNeutral = function ( oSettings )
{
oSettings.aaSorting = [];
oSettings.aiDisplay.sort( function (x,y) {
return x-y;
} );
oSettings.aiDisplayMaster.sort( function (x,y) {
return x-y;
} );
oSettings.oApi._fnReDraw( oSettings );
};
However, I do not know how to do this. Does anyone know what “oApi” is, or do I need one more setting before using this plugin?
As my script shows Uncaught TypeError: Cannot read property 'oApi' of undefined , right after copying the script, and the error calls the undefined function. What should I do?
source
share