hide data from contextmenu

I would like to hide data from contextmenu based on a condition.
ex .

UI.TableContextMenu =
{id:‘varContextMenu’,view:‘contextmenu’, data:[‘Mango’,‘Rose’]};

if its a fruit - I need to display Mango
if its a flower - I need to display Rose

how do i do that dynamically ?

Hello, @venky

To solve the issue, for the contextmenu data you could create a custom property, that would stick each data item to one of the datatable items (fruit, flower, etc.).
When the contextmenu is shown, filter its items, using the created custom property. To catch the moment contextmenu is shown is possible with onShow event.

Here is the snippet Code Snippet