Open kovadam69 opened 3 years ago
Could be related: https://github.com/vaadin/flow-components/issues/1939
Well it's a similar problem, but actually the data is there, just not before the dynamiccontenthandler is called... I think it would be enough to somehow switch the orders how the data population from the client side is handled, and populate the clicked column id before the dynamic context menu callback has been called... it would be a nice add-on to have the clicked columnid in the event, but not necessary, it can be accessed using getElement().getProperty()...
Description
In Grid there is a method updateContextMenuTargetItem which updates the key and column Id from client side using properties. However this method is called and thus column ID is populated after the attached GridContextMenu's dynamicContentHandler has been called. Therefore it is impossible to build a context menu which related to a specific column in the Grid. This is especially necessary for Grid Header related Context Menus (like sorting, filtering, data ordering, etc.).
Expected outcome
I expect the clicked column ID to be populated before the dynamicContentHandler will be called, so assembling a Context Menu can relay on column ID information.
Actual outcome
Currently I have to click the column twice, because the first click has either no column id (empty string at first click ever) or the previously clicked column's ID.
Steps to reproduce
Environment