Wadi Gong
Wadi Gong

Reputation: 25

How to expand Master Detail in ag grid using separate button?

enter image description here

How do I show or hide master detail portion using separate button instead of clicking the arrow button in first column? thanks

Upvotes: 1

Views: 1766

Answers (1)

Pratik Bhat
Pratik Bhat

Reputation: 7614

You can get the row index of the master row you want to expand -

Call the below onClick of button.

showDetail(index) {
    this.gridApi.getDisplayedRowAtIndex(index).setExpanded(true);
}

An example from docs where detail grid is expanded in onFirstDataRendered

Upvotes: 2

Related Questions