footerCallback get data

footerCallback get data

fedeinfedein Posts: 22Questions: 7Answers: 1

Hello everyone!!

I need get a data into a footerCallback. How can i get it?

Is for something like this:

"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;
            };                                                                      

                    **if (data['var']==1)   **                  
                        total = api.column( 8 ).data().reduce( function (a, b) {                                
                            return intVal(a) + intVal(b);

                        },0 );

Thank you very much!!!

Replies

  • kthorngrenkthorngren Posts: 20,322Questions: 26Answers: 4,774

    I guess you are asking about data['var']. What is data['var']? Please provide details of what you want to do when data['var']==1.

    Kevin

  • fedeinfedein Posts: 22Questions: 7Answers: 1

    Hi kthorngren, thank you for you answer!

    data['var'] is the data of json response.

    Sorry for my bad english, regards!!

  • kthorngrenkthorngren Posts: 20,322Questions: 26Answers: 4,774

    You can use ajax.json() to get the JSON response if you are using ajax.

    Kevin

  • fedeinfedein Posts: 22Questions: 7Answers: 1

    Thank you very much Kevin!!!!

This discussion has been closed.