datagrid icon indicating copy to clipboard operation
datagrid copied to clipboard

Two datagrids (different components) on same page - ItemsDetail bug

Open BigOHenry opened this issue 6 years ago • 3 comments

Hello, when i have two different datagrids (different components) on the same page and both has ItemDetail function there is a conflict:

Use case 1: 1) datagrid 1 - click at eye on row with primary key 10 and item detail is shown correctly and click again to close it. 2) datagrid 2 - click at eye on row with primary key 10 (different data but same key) -> on datagrid 1 is shown detail on row with key 10 = Eye buttons from key 10 from both datagrids showing detail from datagrid 1

Use case 2: 1) datagrid 2 - click at eye on row with primary key 10 and item detail is shown correctly and click again to close it. 2) datagrid 1 - click at eye on row with primary key 10 (different data but same key) -> on datagrid 2 is shown detail on row with key 10 = Eye buttons from key 10 from both datagrids showing detail from datagrid 2

If there are no same keys, everything working correctly but when there are same keys in both datagrids, depends which one has been clicked first.

BigOHenry avatar Jun 21 '19 14:06 BigOHenry

@paveljanda This is a bug in javascript. Results of itemDetail requests are cached (hidden), but the jQuery selector is global and not restricted to current datagrid only - Therefore cached version from first datagrid is found and shown.

peldax avatar Jul 29 '19 11:07 peldax

Any idea how to fix it?

BigOHenry avatar Aug 12 '19 07:08 BigOHenry

You need to modify jquery selectors to operate only on current datagrid - currently it searches globally.

peldax avatar Aug 14 '19 10:08 peldax