institut-de-genomique / Ultimate-DataTable

This AngularJS directive generate a HTML table with build-in fonctionnality like save, edit, remove, pagination etc...
http://institut-de-genomique.github.io/Ultimate-DataTable/
45 stars 26 forks source link

Is footerCallback implemented? #43

Closed gabriele86 closed 6 years ago

gabriele86 commented 6 years ago

Is footerCallback currently implemented or there's a way to add a tfooter tag with the sum of specific column value?

galbini commented 6 years ago

Hi,

to have a sum on a column you need used the group function.

In your configuration 1/ activate group function see https://ultimate-datatable.readthedocs.io/en/latest/configuration/#group 2/ add groupMethod = sum on your column. see https://ultimate-datatable.readthedocs.io/en/latest/columns-configuration/#group-method 3/ add group on column that you want used as aggregate see https://ultimate-datatable.readthedocs.io/en/latest/columns-configuration/#group or go to the menu group and select group all

gabriele86 commented 6 years ago

Thanks a lot for your reply it's works correctly, just another information, using the render method to add custom content to a column is it possible call a custom function on ng-click passing to this function a value of other table columns?

For example i need somethings like this

 render: <button class='btn btn-primary fa fa-plus' ng-click='ngFunction(record_id)'></button>,

where record_id is a value of column with index 0 for example

galbini commented 6 years ago

Hello,

yes you can with this form :

render: "<button class='btn btn-primary fa fa-plus' ng-click='ngFunction(value.data.record_id)'></button>"

value.data = object used in the line of UDT. cellValue = value of the current cell