Is it possible to make the footer editable in treetable?
If not, do I have to insert a last row as “footer”?
Is it possible to make the footer editable in treetable?
If not, do I have to insert a last row as “footer”?
… additionally I defined my own calculation-method for footer. But I need to call it manually after doing some calculations… How can I call it manually?
This is my function:
webix.ui.datafilter.ColumnSum = webix.extend({
refresh: function(master, node, value){
var result = 0;
master.data.each(function(obj){
if(obj.id.split(".").length === 1){
if (obj[value.columnId]){
result = parseInt(result) + parseInt(obj[value.columnId]);
}
}
node.firstChild.innerHTML = result;
});
}
}, webix.ui.datafilter.summColumn);
Refresh is called automatically on data update.
The main way to change the footer’s content manually is to set its value and call refreshColumns, something like
grid.getColumnConfig("votes").footer[0] = { text:"some" }
grid.refreshColumns();
But, there’s also a possible trick: you can add some custom condition in refresh
and update the data depending on it. To trigger the update manually, you can change the condition and call refreshColumns():