It works basically the same way, just the other way around.
The mission grid battles project for ORK 2 has such a setup if you want to check it out.
It works like this (done in the battle events of your move command), first getting the enemies that can attack:
- get all enemies of the moving combatant via Search Combatants node
- use a Grid Move Out Of Range node with Move In Range enabled for those enemies to get those where the moving combatant moves into attack range
Next, you perform the attack via Use Battle Action node (used as Sub Action, i.e. it's part of the ongoing grid move action to prevent interference with the battle order) each time you move to a new cell.