enterprise
enterprise copied to clipboard
Datagrid: New row added to the top in data grid cannot be selected
Describe the bug New row added to the top isn't located at top.
To Reproduce Go to this stackblitz https://stackblitz.com/edit/ids-quick-start-1421-m8kuzg?file=src/app/odd-data-grid/odd-data-grid.component.ts
Steps to reproduce the behavior:
- Add few rows
- Click on '....'
- Look in console
- See error
Expected behavior New row added to the top should be correct selected
Version
- ids-enterprise-ng: 14.2.1
Screenshots

I see the problem but i dont get how the item.id in this line has any connection to the datagrid.
<a soho-popupmenu-label (click)="onMenuItemSelected(item.id)">
Maybe you can do something like:
onMenuItemSelected(action: any): void {
switch (action) {
case 'delete':
console.info(grid.dataset[grid.activeCell.row].id);
break;
}
}
What do you think about this one @ericangeles am i off base?
I have another stackblitz where I have removed the popupmenu. https://stackblitz.com/edit/ids-quick-start-1421-hqbupu?file=src/app/app.component.ts
And the issue is present there as well.
Yeah that lasts case is showing an issue... That we should fix, for someone that picks this up:
- go to https://stackblitz.com/edit/ids-quick-start-1421-hqbupu?file=src/app/app.component.ts
- click in the text field and type something, then click add row
- click the info icon and look a the console
- notice in the data element the row seems in the wrong order and the item is incorrect
- check on new rows at both top and bottom
btw, I found a similar issue. might be related to same part of code. If I add toolbar with search filter, and then search on some item on the row, and select the item in it. the selected item is not the actual item which got selected.
I can create another stackblitz for it to re-produce the error if needed.
ok i'll let you be the judge but maybe we should have two issues so the steps are very clear.
Hello @tmcconechy and @guoliang ,
I cannot reproduce this issue anymore in both EP and NG. I made an example page directly with the project. I used your data and structure in the example page. Please see it in the Pull Request.
@tjamesallen15 can you reference that PR in here?
@tjamesallen15 can you reference that PR in here?
https://github.com/infor-design/enterprise-ng/pull/1393
This issue is now resolved.