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

Using sum() will point to error in js file

$
0
0

Hi there,

I'd like to sum up one column. Therefor I am using the sum plugin. I created a file called "plugins.js" with the following content:
https://github.com/DataTables/Plugins/blob/master/api/sum().js

Then, I used this plugin in my index.php the following way:

<script src="DataTables/plugins.js"></script>
$(document).ready(function() {
     $('#example').DataTable( {
          drawCallback: function () {
            var api = this.api();
            $( api.table().footer() ).html(
                api.column( 3, {page:'current'} ).data().sum()
            );
           }
     } );
} );

After that, my table won't load. Following error message occurs:
line 39 of plugins.js: TypeError: undefined is not an object (evaluating 'jQuery.fn.dataTable.Api')
https://www.dropbox.com/s/wvruu6gh00zsv85/sumerror.jpg?dl=0

Any idea what went wrong here?
Thank you for your help!


Viewing all articles
Browse latest Browse all 82624

Latest Images

Trending Articles



Latest Images

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