I have a data grid containing the student's information with a checkbox for each row. The requirement is when the user selects a row or multiple rows and clicks on the show information Button it opens a new window that shows the list of students with their information. For now, I can select multiple rows but when I click on the button it shows only the information of the first students. I want to show all the selected rows on one list. My code:
public returnResults(): ReaOnlyArray<String> {
const selectedNodes = isNil(this.gridOptions)||isNil(this.gridOptions.api)? [] this.gridOptions.api.get SelectedNodes();
return selectedNodes.length >1 ? ['show Students']: ['show student']
}
public btnClicked(): void {
const selectedNodes = this.gridOptions.api.get SelectedNodes();
const selectedNode = first(selectedNodes);
const selectedNodeData: Grid = selectedNode.data;
if(!isNil(selectedNodeddata)&& !isNil(slectedNodeData.result)){
this.infDate = DateUtils.ngFormatDate(slectedNodeData.result.infDate);
this.loading=false;
const modOptions: ModalOptions =(class: mod-xl, backdrop: 'static', keyboard: false);
this.showInfModel= this.modalService.show(this.showStudentInfo, modOptions);
}
}
And in the html file contains the template for one student's infomation. I tried several snipped codes to iterate through multiple nodes and return the data in a new window and they did not work for me