Change style of some dimension rows

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

    • Post Options:
    • Link

    Posted 29 September 2023, 10:28 am EST - Updated 29 September 2023, 10: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, 11:04 pm EST - Updated 3 October 2023, 12:52 am 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, 9: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, 9: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