5.20231.904
5.20231.904

TransposedMultiRow Styling Records, Groups and Cells

In most of the applications, you would want to show where each record and group starts or ends. The TransposedMultiRow control enables this by adding CSS class names to cell elements in the first and last row/column of each group. The class names are wj-record-start, wj-record-end, wj-group-start, and wj-group-end.

The example below shows how you can use these class names in CSS rules to customize the appearance of the record and group delimiters. It also shows how you can use the standard cssClass property to customize the appearance of specific cells within groups.

/* custom styling for a TransposedMultiRow */

.wj-transposed-multirow .wj-cell.wj-record-end:not(.wj-header) {
    border-bottom: 1px solid #000; /* thin black lines between records */
}
.wj-transposed-multirow .wj-cell.wj-group-end {
    border-right: 2px solid #00b68c; /* thick green lines between groups */
}
.wj-transposed-multirow .wj-cell.id {
    color: #c0c0c0;
}
.wj-transposed-multirow .wj-cell.amount { 
    color: #014701;
    font-weight: bold;
}
.wj-transposed-multirow .wj-cell.email {
    color: #0010c0;
    text-decoration: underline;
}

The cssClass property can be added in the layoutDefinition.

import { TransposedMultiRow } from '@grapecity/wijmo.grid.transposedmultirow';

var multirow = new TransposedMultiRow('#trnMultirow', {
    itemsSource: appData.orders,
    layoutDefinition: [
        {
            header: 'Order', colspan: 3, cells: [
                { binding: 'id', header: 'ID', rowspan: 2, cssClass: 'id' },
                { binding: 'amount', header: 'Amount', format: 'c', rowspan: 2, cssClass: 'amount' },
                { binding: 'date', header: 'Ordered' },
                { binding: 'shippedDate', header: 'Shipped' }
            ]
        },
        {
            header: 'Customer', colspan: 3, cells: [
                { binding: 'customer.name', header: 'Name' },
                { binding: 'customer.address', header: 'Address', rowspan: 2 },
                { binding: 'customer.city', header: 'City', dataMap: cityMap },
                { binding: 'customer.email', header: 'EMail', rowspan: 2, cssClass: 'email' },
                { binding: 'customer.state', header: 'State', width: 45 },
                { binding: 'customer.phone', header: 'Phone' },
                { binding: 'customer.zip', header: 'Zip' },
            ]
        },
        {
            header: 'Shipper', colspan: 3, cells: [
                { binding: 'shipper.name', header: 'Shipper' },
                { binding: 'shipper.email', header: 'EMail', cssClass: 'email' },
                { binding: 'shipper.express', header: 'Express' }
            ]
        }
    ]    
});