enterprise icon indicating copy to clipboard operation
enterprise copied to clipboard

Datagrid: New row added to the top in data grid cannot be selected

Open guoliang opened this issue 3 years ago • 7 comments

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:

  1. Add few rows
  2. Click on '....'
  3. Look in console
  4. See error

Expected behavior New row added to the top should be correct selected

Version

  • ids-enterprise-ng: 14.2.1

Screenshots image

guoliang avatar Aug 11 '22 10:08 guoliang

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;
    }
  }

tmcconechy avatar Aug 11 '22 13:08 tmcconechy

What do you think about this one @ericangeles am i off base?

tmcconechy avatar Aug 11 '22 13:08 tmcconechy

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.

guoliang avatar Aug 11 '22 14:08 guoliang

Yeah that lasts case is showing an issue... That we should fix, for someone that picks this up:

  1. go to https://stackblitz.com/edit/ids-quick-start-1421-hqbupu?file=src/app/app.component.ts
  2. click in the text field and type something, then click add row
  3. click the info icon and look a the console
  4. notice in the data element the row seems in the wrong order and the item is incorrect
  5. check on new rows at both top and bottom

tmcconechy avatar Aug 11 '22 15:08 tmcconechy

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.

guoliang avatar Aug 11 '22 16:08 guoliang

ok i'll let you be the judge but maybe we should have two issues so the steps are very clear.

tmcconechy avatar Aug 11 '22 16:08 tmcconechy

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 avatar Oct 19 '22 02:10 tjamesallen15

@tjamesallen15 can you reference that PR in here?

ericangeles avatar Oct 21 '22 05:10 ericangeles

@tjamesallen15 can you reference that PR in here?

https://github.com/infor-design/enterprise-ng/pull/1393

tjamesallen15 avatar Oct 27 '22 02:10 tjamesallen15

This issue is now resolved.

CindyMercadoReyes avatar Oct 31 '22 18:10 CindyMercadoReyes