Adds onAttach triggerMethod.

Adds `triggerAttach` and `beforeTriggerAttach` triggerMethods.

This is the 3rd out of 3 PRs to get #1886 in.
If you're instanciating a layoutView above, you could do `this.layout.onBeforeShow = function() {}` and save some lines. Also, you're not introducing a `CustomLayout` term.