How update the sum of a columns when filter is applied?

How update the sum of a columns when filter is applied?

miccarmiccar Posts: 2Questions: 1Answers: 1

I have in the footer the sum of all data of a column, but when a filter is applied, only the data in the current page is summed, if i don't want to set paging:false, how can i manage the code of default DataTable example ?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,352Questions: 26Answers: 4,955

    I think you can try the selector-modifier as described in the columns().data() docs for this.

    Kevin

  • miccarmiccar Posts: 2Questions: 1Answers: 1
    Answer ✓

    From the example page, i replace page:'current' with filter:'applied' and all works fine

  • rimoirimoi Posts: 2Questions: 0Answers: 0
    edited July 2019

    thank you @miccar it helped me !

    api.column(number_of_column , {filter:'applied'}).data()

  • salimkhansalimkhan Posts: 2Questions: 1Answers: 0

    I have use datatable, now i want to sum only the filtered price, how to do that plz
    Thanks

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    @salimkhan - I replied on your other thread - please only post once.

    Colin

Sign In or Register to comment.