0

In gridColumns i am setting the rowDrag: true. This creates a default icon for all the rows having children or single rows. But i wanted to have this icon only for particular rows by setting the visibility of a drag icon as hidden.

More over if i populate rowDrag true or false conditionally, then rows for which i dont want drag icon, icon won't come but its breaking the alignment. That's why i want something explicitly where i can set the rowDrag for all rows as true and then explicitly set the visibility as hidden.

Please help me in this case. not finding any solution.

Deepender Sharma
  • 460
  • 1
  • 5
  • 25

1 Answers1

1

If you just want to hide the drag icon you need to override the CSS. Just assign css class to the rows you want to hide and then in the CSS file make the visibility as hidden.

Assign class as below

this.rowClassRules = {
   "hide-row-drag-class": function(params) {
     if (params.node.rowIndex % 2 == 0) {
       return true;
     }
   }
};

Override CSS file

.yourTheme .yourClass .ag-row-drag{
        visibility: hidden;
}

The above code assigns a CSS class to all odd rows and then will hide the row drag icon based on the CSS

https://plnkr.co/edit/dIfq96KHFmEx25BnC5ze?p=preview

koolhuman
  • 1,581
  • 15
  • 25