Search in sources :

Example 1 with AggregationContainer

use of com.haulmont.cuba.web.toolkit.data.AggregationContainer in project cuba by cuba-platform.

the class CubaTable method paintAdditionalData.

@Override
protected void paintAdditionalData(PaintTarget target) throws PaintException {
    if (reqFirstRowToPaint == -1) {
        boolean hasAggregation = items instanceof AggregationContainer && isAggregatable() && !((AggregationContainer) items).getAggregationPropertyIds().isEmpty();
        if (hasAggregation && isShowTotalAggregation() && Table.AggregationStyle.TOP.equals(getAggregationStyle())) {
            Context context = new Context(getAggregationItemIds());
            paintAggregationRow(target, ((AggregationContainer) items).aggregate(context));
        }
    }
    // paint cuba-ids
    AppUI current = AppUI.getCurrent();
    if (current != null && current.isTestMode()) {
        ArrayList<String> visibleColOrder = new ArrayList<>();
        for (Object columnId : visibleColumns) {
            if (!isColumnCollapsed(columnId)) {
                visibleColOrder.add(columnId.toString());
            }
        }
        target.addAttribute("colcubaids", visibleColOrder.toArray());
    }
}
Also used : AppUI(com.haulmont.cuba.web.AppUI) AggregationContainer(com.haulmont.cuba.web.toolkit.data.AggregationContainer)

Example 2 with AggregationContainer

use of com.haulmont.cuba.web.toolkit.data.AggregationContainer in project cuba by cuba-platform.

the class CubaTreeTable method paintAdditionalData.

@Override
protected void paintAdditionalData(PaintTarget target) throws PaintException {
    if (reqFirstRowToPaint == -1 && items instanceof AggregationContainer && isAggregatable() && !((AggregationContainer) items).getAggregationPropertyIds().isEmpty() && isShowTotalAggregation() && Table.AggregationStyle.TOP.equals(getAggregationStyle())) {
        paintAggregationRow(target, ((AggregationContainer) items).aggregate(new Context(items.getItemIds())));
    }
    // paint cuba-ids
    AppUI current = AppUI.getCurrent();
    if (current != null && current.isTestMode()) {
        ArrayList<String> visibleColOrder = new ArrayList<>();
        for (Object columnId : visibleColumns) {
            if (!isColumnCollapsed(columnId)) {
                visibleColOrder.add(columnId.toString());
            }
        }
        target.addAttribute("colcubaids", visibleColOrder.toArray());
    }
}
Also used : AppUI(com.haulmont.cuba.web.AppUI) AggregationContainer(com.haulmont.cuba.web.toolkit.data.AggregationContainer)

Aggregations

AppUI (com.haulmont.cuba.web.AppUI)2 AggregationContainer (com.haulmont.cuba.web.toolkit.data.AggregationContainer)2