Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter microtune

    (@microtune)

    Thank you for your response!

    It turns out, the issue was not caused by the plugin but by my own mistake. I blocked back-end access for non-admin users, and forgot to exclude access to admin-ajax.php for AJAX calls. So the plugin could not pull any data.

    Sorry for not recognizing sooner.

    The plugin is very useful.

    Thread Starter microtune

    (@microtune)

    I created a test account if you need to see the problem, but I do not want to make that information public, I could send the credentials in a pm.

    Once again, the front-end map does not work when a WP user other than an admin is logged in while viewing the site. It does work flawlessly when an admin is viewing the page, or when the visitor is not logged into WP. (I tested that, but normally the site can be viewed only when logged in.)

    Thank you!

    Thread Starter microtune

    (@microtune)

    Hello Tobias,

    Thank you so very much!

    I added the code as a “Custom Command” as you suggested in #2, and it worked like a charm!

    (I had to modify the function itself to behave exactly as I needed, but that is irrelevant, your solution was right on target.)

    Adding “fnFooterCallback” simply to your “Custom Commands” textfield on the “Edit” screen of the table would also work for displaying the number of rows correctly after filtering as the other thread you suggested wanted to have.

    Thank you again!
    microtune

    Thread Starter microtune

    (@microtune)

    Thank you for your quick reply!

    I found that what I need can be done with the DataTables footer callback.

    They give an example for the initialisation code:

    $('#tablepress-1').dataTable( {
            "fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
    
                var iTotalMarket = 0;
                for ( var i=0 ; i<aaData.length ; i++ )
                {
                    iTotalMarket += aaData[i][1]*1;
                }
    
                var iPageMarket = 0;
                for ( var i=iStart ; i<iEnd ; i++ )
                {
                    iPageMarket += aaData[ aiDisplay[i] ][1]*1;
                }
    
                var nCells = nRow.getElementsByTagName('th');
                nCells[1].innerHTML = parseFloat(iPageMarket);
            }
        } );

    I just was not able to figure out how to add the ‘fnFooterCallback’ parameter to the existing call for dataTable. But I was able to call from the table page with the above code, and the summation works.

    However, the page gives the following error message:
    “DataTables warning (table id=’tablepress-1′):Cannot reinitialise DataTable.

    I understand the problem, but since I am not familiar with your code, it would take me forever to figure out how to add the function parameter to the existing code.

    If it does not take too much of your timetime, could you please give me some pointers on how to integrate this function into the dataTable code?

    I am using the column filter widgets and the tabletools plugins.

    Thank you so much!

Viewing 4 replies - 1 through 4 (of 4 total)