Formulas and Data Tables, client or server sided?
Formulas and Data Tables, client or server sided?
sm1l3y
Posts: 24Questions: 7Answers: 0
What works best with and/or does data tables prefer when it comes to formulas, done by client sided (js) or server sided (c#, sql, etc)? For example a column which content is generated by a formula which includes other columns or even the sum of another?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
It would depend on the calculations you're looking to do. Client side is easiest to implement and maintain using the following example below.
In this example it is relatively easy to do calculations at run-time as opposed to doing it server side. If you're doing it server side it could potentially make things faster for the user but its negligible from my experience.
Thank you, any idea how i would also access the footer and a column for a calculation?
From my knowledge the built in excel generation is a bit of a tricky beast to work with. I'd defer to someone else for this question but it's a good one I've had myself.
The footer can be access using
column().footer()
.Allan
For future reference for anyone, I did the calculations upon the returned JSON data before passing it to the data tables API. For instance AJAX call > resulting data into JSON > custom calculations > then passed to data tables api.