My pastor referenced Luke 11:1 in a sermon today about prayer. Being a dutiful Greek student, I had my UBS4 Greek NT with me. Mostly, I can keep up when reading the Greek with the English (ESV) open next to it. This time, the sentence structure has me completely baffled. Even after looking at it more this afternoon, even after looking at Accordance's Greek diagramming module, this sentence still does not make sense to me.

Here's the Greek of the NA28:

```
Καὶ ἐγένετο ἐν τῷ εἶναι αὐτὸν ἐν τόπῳ τινὶ προσευχόμενον

```

Here's the ESV translation of that portion:

```
Now Jesus was praying in a certain place

```

The KJV actually gets a little bit closer to something that makes sense to my brain:

```
And it came to pass, that, as he was praying in a certain place

```

The NASB also seems to take a similar tack:

```
It happened that while Jesus was praying in a certain place

```

I kind of understand the KJV and NASB versions, and I can see how the ESV is a more common way of saying a similar thing. But all of those seem to ignore two parts of the sentence, from how I'm reading it. Those parts would be `ἐν τῷ εἶναι` and `αὐτὸν`. 

Can someone help me see how those parts fit into this sentence? Is there a common NT Greek grammar rule I'm missing? Is this idiomatic?