Multiple tabs with diferent querys

Multiple tabs with diferent querys

GenjosanzoGenjosanzo Posts: 6Questions: 1Answers: 0

I have a huge database, with a lot of tables, i need to see different results on the different tabs and then use that results inother tabs, what i can do? thanks

Replies

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin

    I'd apply a different where condition to whatever it is that you are using to get the data. You could have different Ajax end points for each one.

    Allan

  • GenjosanzoGenjosanzo Posts: 6Questions: 1Answers: 0

    Can u say to me how to do? I put in every tab different sql query and result, and in every..

    document).ready(function() {
    Var table* = $('#table_id_*').DataTable( {
    "footerCallback": function ( row, data, start, end, display ) {
    var api = this.api(), data;

            // Remove the formatting to get integer data for summation
            var intVal = function ( i ) {
                return typeof i === 'string' ?
                    i.replace(/[\$,]/g, '')*1 :
                    typeof i === 'number' ?
                        i : 0;
            };
    
            // Total over all pages
            total = api
                .column( 4 )
                .data()
                .reduce( function (a, b) {
                    return intVal(a) + intVal(b);
                }, 0 );
    
            // Total over this page
            pageTotal = api
                .column( 4, { page: 'current'} )
                .data()
                .reduce( function (a, b) {
                    return intVal(a) + intVal(b);
                }, 0 );
    
            // Update footer
            $( api.column( 4 ).footer() ).html(
                '$'+pageTotal +' ( $'+ total +' total)'
            );
        }
    } );
    

    } );

    Bit what i have to do, for count rows, or to use that dates in other tabs to show together in one.

    Then i put a date filter with a div that calculates the total days between the 2 dates, what i have to do to use that value in the footercallback of a tab ?

    Thanks!!!!!

This discussion has been closed.