Get object ID in search event from grid view edit



I implemented own filter on properties via onSearchListBeforeFilterPrepare event. It works well when opening search dialog (eg for href) from edit page of given object. The event then has context field with id of an object

[context] => {"scope":"objectEditor","containerType":"object","fieldname":"Country","objectId":245072}

But if I open the same search dialog from grid and try to edit href field of the object, the id of this object is not passed

[context] => {"scope":"objectEditor","containerType":"object","fieldname":null}

Is there a way to get the id also when editing object in grid view? Or is this missing?

Thanks a lot