Hi Enas,
Greetings from Syncfusion Support.
In response to your request, we have prepared a sample
demonstrating how to expand and collapse the Child Grid using the command
column button. Please find the code snippet and sample below for your
reference:
|
[index.js]
function commandClick(args) {
if (args.commandColumn.buttonOption.content === 'Expand/Collapse') {
let rowIndex = parseInt(
args.target.closest('.e-row').getAttribute('data-rowindex')
);
let isExpanded =
args.target.closest('.e-row').firstChild.getAttribute('aria-expanded') ===
'true'
? true
: false;
if (isExpanded) {
this.detailRowModule.collapse(rowIndex);
} else {
this.detailRowModule.expand(rowIndex);
}
}
}
|
Sample: https://stackblitz.com/edit/command-column-expand-collapse
Feel free to reach out if you have any further queries.
Regards,
Santhosh I