I can't get sum of column's value after searching(searching with bottom select tag).

I can't get sum of column's value after searching(searching with bottom select tag).

jacksononejacksonone Posts: 2Questions: 1Answers: 0

Hello, This is jackson one , as a larave and node expert. I love datatables.net and often use to use those for building my a lof of project. today I have one question while build booking system and car retail management system.
I can get sum of row's value after loading table, but I can't get those after searching(searching with bottom select tag).
Of course, I can get sum after loading table using drawcallback function. but not after searching.
Is it possible? If you have some experiences in this case,let's discuss it and exchange our experiences.
I put my screenshot to explain my problem in detail.
Thanks. Jackson one.

https://prnt.sc/romcul
https://prnt.sc/romd21
https://prnt.sc/romd5i

Answers

  • kthorngrenkthorngren Posts: 20,141Questions: 26Answers: 4,736

    You have api.columns( 7 ).data().sum(); to get the sum. Use the selector-modifier of { search: 'applied' } like this api.columns( 7, { search: 'applied' } ).data().sum();.

    Kevin

This discussion has been closed.