Hi, may I know what can we do to get the datatable column sum which outside datatable? Is there some function like getColumnSum?
do you mean a field which is not a column?
you can create custom datafilter like “summColumn” and in “refresh” method calculate required field.
refresh:function(master, node, value){
var result = 0;
master.data.each(function(row){
var fieldValue = row.myField*1;
if (isFinite(fieldValue)){
result += fieldValue;
}
});
if (value.format)
result = value.format(result);
if (value.template)
result = value.template({value:result});
node.firstChild.innerHTML = result;
}
https://webix.com/snippet/2b1ae7f4
find “summColumn” source in debug version.
Hi @intregal , I means I would like to get sum outside the datatable. For example, to show the sum in the text field.
What I want to achieve is to get the sum of the column after the data loaded as well as new row added. And I need to display the sum outside the datatable as well as need to use the sum for other calculation.