Author Topic: Possibility of automatic totals?  (Read 2222 times)

wmwa

  • Pro Economy
  • Newbie
  • *
  • Posts: 19
    • View Profile
Possibility of automatic totals?
« on: May 02, 2015, 12:42:32 am »
I know we can do a grid summary by using the demo provided, which appends a summary row to the bottom of the grid, and contains the calculations for the running total.

However, I'm working on a system where we would like to define the parameters of the grid based on data coming back from the host. That is, have one grid on the screen, but generate it differently based on user parameters. For that reason, it isn't quite feasible for me to hard code in the column numbers, or even the dataIndx in order to get that total, since the number of totaled columns, and even the names could change.

I see that there is a "colModel->summary" option in the API, but it seems to indicate that it is used for the purposes of the groupModel. Is there any way to simply mark a column as one that needs to be totaled, then get a total down at the bottom without going through the whole "calculateSummary" routine and updating on refresh?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Possibility of automatic totals?
« Reply #1 on: May 04, 2015, 12:52:44 pm »
I'm afraid currently that is the only way to calculate summary at the bottom with fixed rows.

You may generalize the calculateSummary function so that there are no hardcoded dataIndx inside it or you may do the calculations on server side and include it as part of dynamic grid data.

However I've added it as feature request for further analysis and simplification, thanks for your feedback.
« Last Edit: May 04, 2015, 07:26:33 pm by paramquery »