Lately I have switched what I used to do.
I USED to mount them on the panel and wire directly to them.
Now I mount them off the panel and put one or two (as required) molex connectors between the panel and the encoder. This allows for easy swappable panels in the future, easier repairs, etc, etc, etc.
One downside is that it takes an extra hour, and adds $5-8 to the cost.