4
votes

I'm using Angular UI Grid and the ui-grid-expandable plugin. Is there a way to decide for each row, if the expand button (+) is displayed? By default it is always displayed, no matter if there is available data in the subgrid.

Thanks.

3
may be getTreeState() but it seems not working: ui-grid.info/docs/#/api/ui.grid.treeBase.api:PublicApi - Asqan

3 Answers

5
votes

Sadly no, there is not an option for that as of now.

You can use the following to make things work as you wish:

  • remove default row headers by setting to false enableExpandableRowHeader
  • adding a custom row header by calling $scope.gridApi.core.addRowHeaderColumn

This way you can build your own logic. I did something like that in this plunkr.

If you need more info:

0
votes

I have a pull request with UI-GRID that solves this.

You add a boolean to the subGridOptions called disableRowExpandable.

https://github.com/angular-ui/ui-grid/pull/6135/commits/83ade3445711e532f689d224904babfe92c7b45e

0
votes

Yes you can !

Add to subGridOptions object this option:

disableRowExpandable:(condition here).