Footer_callback is not working

Footer_callback is not working

kaustubh.agrawal2000kaustubh.agrawal2000 Posts: 88Questions: 39Answers: 2

I am using datatable footerCallback callback to show sum of values.. and show it in the footer..
but I am having following 2 problems...
1) The api
this.api.column( 3,{ page: 'current'} ).data()
does not take into account the "columnDefs" updated values but takes the values returned by the API...

2) The sum is not showing on the footer...

Steps to reproduce

goto https://gadhiya.in
login: UNAME : kaustubh.agrawal2012@gmail.com
PWD : 12345678

goto: https://gadhiya.in/ledger
click : "submit" button.
Table is populated but the footer is still blank..

Target src code : http://gadhiya.in/web/js/ledger.js

Answers

  • colincolin Posts: 12,490Questions: 0Answers: 2,118

    Hi @kaustubh.agrawal2000

    1.

    Take a look at this example, this is showing rendered and unrendered total in the footer. column().data() will take the unrendered, so you need to use the cells().render() method to get the rendered value back.

    2.

    I just took a look and the footer is empty, so nothing is being written. The code looks OK, but it would be worth adding some debug to see if it is being called, and what string is trying to be written to the footer. There are some errors in the console, but I don't think that should affect the footer, so the debug would be useful there to see.

    Hope that helps,

    Cheers,

    Colin

This discussion has been closed.