I am trying to make a custom math function for datatable to sum up certain cells in each row if the id contains “hours”. In order to do so, I need to retrieve the cells in a row along with their id’s. I have tried assigning the datatable to a variable and using getItem(rowID) to access the values, however it doesn’t work on load as it seems to be calling my custom function before the dataTable variable gets assigned. Is there another way for me to retrieve these row values?
dataTable = webix.ui({
//later in webix config
{id: “Sum”, math: “sumHours($r)” }
function sumHours(rowID) {
//rowID does get passed, but the function breaks on the getItem() call.
var row = dataTable.getItem(rowID);
}
Additionally, my math function does not seem to run on any new rows that I add to the table.