Append Data to tfoot with FooterCallback

Append Data to tfoot with FooterCallback

zgoforthzgoforth Posts: 493Questions: 98Answers: 2
edited June 2021 in DataTables 1.10

Link to test case: https://jsfiddle.net/BeerusDev/vzehsqn8/159/
Hello,

I have finally figured out how to create the count and it works perfectly in my footerCallback, I cannot get it to append to the tfoot though. What am I doing wrong?

Answers

  • zgoforthzgoforth Posts: 493Questions: 98Answers: 2
    edited June 2021

    That was extremely impatient of me to post^. I figured it out on my own, it didn't take much time.

    I was able to do the following at the end of my footerCallback:

    $( api.column( 11 ).footer() ).html( "Present: " + "("+totalCount.P+"), " + "Telework: " + "("+totalCount.TW+"), " + "Not Recorded: " + "("+totalCount.NR+"), " + "Travel: " + "("+totalCount.TRV+"), " + "PTO: " + "("+totalCount.PTO+"), " + "Holiday: " + "("+totalCount.H+"), ");
                      }); 
    

    In my other post, you mentioned I could apply the https://datatables.net/reference/type/selector-modifier so that this footerCallback will still work with the filter. Right now, when I click on the week of the 14th of this month, it shows the one value in my dataset, but the footerCallback shows the same results that were there prior to using the date picker (the current week values).

    As well as my #under_txt that shows the week of under the table header, how can I get that to updated based off of the date picker value that filters the table?

    Here is my working example: https://jsfiddle.net/BeerusDev/vzehsqn8/176/

Sign In or Register to comment.