Change style of some dimension rows

Posted by: carlos.almeida on 29 September 2023, 1:28 am EST

    • Post Options:
    • Link

    Posted 29 September 2023, 1:28 am EST - Updated 29 September 2023, 1:33 am EST

    Hello,

    We need to change the sytle of some cells of the c1-pivot-grid.

    Our pivot grid uses some kind of hierarchy among the categories we show in a single dimension column. Is there a way to set some kind of highlight to some of these rows. The ones inside the red rectangles in the attached image.

    Thanks,

  • Posted 2 October 2023, 2:04 pm EST - Updated 2 October 2023, 3:52 pm EST

    Hi,

    Based on the provided Image, it appears that your intention is to emphasize specific cells within the rowHeader. To achieve this, you can utilize the itemFormatter and apply a custom CSS class to the row header cells you wish to highlight. For a detailed explanation and a working example, please refer to the code snippet and accompanying sample provided below.

      function pivotItemFormatter(panel, row, col, cell) {
            let binding = panel.columns[col].binding;
            // Check if the cell type is 'RowHeader'
            if(panel.cellType === wijmo.grid.CellType.RowHeader){
                let dataItem = panel.grid.collectionView.sourceCollection[row];
                if (dataItem.$rowKey.values.includes("H")) {
                    // Add a custom class to the cell for styling
                    wijmo.addClass(cell, 'custom-class');
                }
            }
    });

    Regards,

    Avinashhighligh rowHeader.zip

  • Posted 3 October 2023, 12:53 am EST

    Thanks,Avinash.

    Could you plase share the URL where I can find the documentation of wijmo.grid.CellType?

  • Posted 3 October 2023, 12:54 am EST

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels