How to hide the glyph icon in first column when using childItemsPath?

Posted by: abhijeet.dey on 22 August 2024, 4:59 am EST

    • Post Options:
    • Link

    Posted 22 August 2024, 4:59 am EST - Updated 22 August 2024, 5:05 am EST

    Hi

    I am using the childItemsPath property to show child rows in my Flexgrid

    Our requirement is to show the expand collapse arrow on the third column (highlighted in green), which we have achieved. But the Flexgrid is showing a glyph arrow icon on the first column in the grid by default (highlighted in red).

    What would be the best way to hide this default arrow icon in first column (highlighted in red)?

    See the attached image

  • Posted 23 August 2024, 6:37 am EST

    Hi Abhijeet,

    We can use formatItem to remove the glyph arrow icon. read more about the formatItem event here : https://developer.mescius.com/wijmo/api/classes/Wijmo_Grid.Flexgrid.html#formatitem.

    We can get the column with the index ‘0’ and then we can querySelect the button with the glyph arrow icon, and can remove it using remove() method

     workersGrid.formatItem.addHandler((s, e) => {
        if (e.panel.cellType == wjGrid.CellType.RowHeader) {
          // added number to the rowHeader
          e.cell.textContent = e.row + 1;
        }
        if (e.panel.cellType == wjGrid.CellType.Cell) {
          if (e.getColumn().index == 0) {
            // get the column with the index 0
            if (e.cell.querySelector('.wj-elem-collapse')) {
              //remove the button
              e.cell.querySelector('.wj-elem-collapse').remove();
            }
          }
        }
      });

    Please refer to the sample for better understanding https://stackblitz.com/edit/js-tkdxku?file=index.js

    In case you need further asssitance do let us know,

    Thanks, and regards

  • Posted 26 August 2024, 8:17 am EST

    Thanks Vivek, I will look into this. I do feel there should be a better configurable way to do this. Like a number property in the Flexgrid class to designate on which column we want the icon to appear in and if it is set to null or -1 then icon will not appear. Please think about adding this feature.

  • Posted 27 August 2024, 2:37 am EST

    Hi Abhijeet,

    Thank you for your suggestion, we have created an enhancement request to add this feature in future releases. We will let you know, when it will be added. The internal tracking ID for the enhancement is WJM-34812

    Thanks, and regards

Need extra support?

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

Learn More

Forum Channels