rowGroup works locally but not when published

rowGroup works locally but not when published

LTechLTech Posts: 5Questions: 2Answers: 1

using MVC .net V4.8 and bootstrap 4.5.3, datatables 1.10.15

The data loads and the code in the initComplete and after the table (to add a print button) runs, but the rowGroup code js debug breakpoint is never hit on the server like it it locally.

I just need to know which of the .js and .css files i may be missing when i bundle them during the publish process. Here's what I have:

            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(

            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(

            bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(

            bundles.Add(new ScriptBundle("~/bundles/customjs").Include(

            bundles.Add(new StyleBundle("~/Content/css").Include(

            bundles.Add(new ScriptBundle("~/bundles/datatables").Include(

            //main datatable css + css for pieces used
            bundles.Add(new StyleBundle("~/Content/datatablesCss").Include(

Here is how I use the rowGroup on the table:

             rowGroup: {
                 startRender: null,
                 endRender: function (rows, group) {

                     // converting to integer to find total
                     var intVal = function (i) {
                         return typeof i === 'string' ?
                             i.replace(/[\$,]/g, '') * 1 :
                             typeof i === 'number' ?
                                 i : 0;

                     //col without formating or div in it - just raw#
                     var totCommission = rows
                         .pluck(7)  //col just for totals
                         .reduce(function (a, b) {
                             return intVal(a) + intVal(b);
                         }, 0);
                     totCommission = $.fn.dataTable.render.number(',', '.', 2, '$').display(totCommission);

                     return $('<tr style="background-color:lightgrey" />')
                         .append('<td colspan="3">(Totals for displayed data only)</td>')
                         .append('<td colspan="3"><div class="float-right">Total Commission for ' + group + '</div></td>')
                         .append('<td><div class="float-right">' + totCommission + '</div></td>');
                 dataSrc: [1]  //order# grouping

This question has an accepted answers - jump to answer


  • allanallan Posts: 54,921Questions: 1Answers: 8,611 Site admin
    Answer ✓

    If you could link to your page that would allow us to debug it.

    What you show above appears to be okay. Maybe the debugger will indicate if one of the libraries isn't loading correctly?


  • LTechLTech Posts: 5Questions: 2Answers: 1

    I figured it out. Even though that version of HAS a rowGroup.min.js file it is EMPTY. Exclude or delete it and it works.

Sign In or Register to comment.